Do you have arcane CS0006 errors haunting you, either in 1.1 or 2.0? Something like this:
Compiler Error Message: CS0006: Metadata file 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\someProject\27bee1ac\cdebe31b\App_Code.glp37_b2.dll' could not be found
Source Error:
|
[No relevant source lines] |
Additional symptoms: when you first build the app it works fine, but then when rebuilding it always comes up with this error. Well, I know of three major reasons for this to occur:
- You've got a signed assembly (DLL) that you haven't installed in the GAC.
- You're using impersonation (via in web.config) and have not installed your DLL to the GAC.
- You have an assembly with a strong name properly installed in the GAC, but have now recompiled and thus have a new version. You have then deleted the older one, leaving the CLR still looking for the older version based on its specific strong name.
For reasons #1 and #2, simply install your assembly in the GAC.
As a sidenote for reason #2, if it's impersonation you're after then you may want to check out Michele's excellent article promoting impersonation on demand:
http://www.theserverside.net/articles/showarticle.tss?id=SandboxingComponents
If you're facing reason #3 from the list, version trouble, then here's a good article on using publisher policy to get around the issue:
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconassemblyversionredirection.asp
And if that's confusing then you may want to start with this introductory article on versioning:
http://msdn.microsoft.com/library/en-us/dndotnet/html/managevers.asp