Thursday, January 11, 2007

Not for publication

After performing a "Publish website" operation on my ASP.NET 2.0 web project, I got the following error upon browsing to the newly-deployed site:

CS0433: The type 'ProfileCommon' exists in both
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\root\dc8cbf9e\f05d928b\assembly\dl3\2f0caf74\881e5468_eec7c601\App_Code.DLL'
and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\root\dc8cbf9e\f05d928b\App_Code.r_z1bmqm.dll '


which is of course quite nonsensical as the two directories listed above are in fact the same.

After some investigation, I found that the root of the problem was that I had marked the website as "Precompiled" during the publish operation AND I had subsequently deleted the "PrecompiledApp.config" file upon completion...

Apparently, that little config file tells the Dotnet runtime that the file is already compiled, and as such shouldn't be compiled (again). Without that file, all kinds of conflicts arise between the precompiled files and the newly-compiled file.

So, in summary.

Publishing websites precompiled GOOD ^-^
Deleting PrecompiledApp.config afterwards BAD >.<