Hotfix Patch for ASP.NET Compilation Issues

ScottGu has posted about a hot fix available for ASP.NET compilation problems that have plagued some of projects we have at work. Symptoms of the issue include wonderful errors like this (care of Scott’s post):
  • Unable to cast object of type ‘ASP.masterpage_master’ to type ‘ASP.masterpage_master’.
  • Could not load file or assembly ‘App_Web_e9dbmaj, Version=0.0.0.0, …
  • Compiler Error Message: CS0006: Metadata file ‘C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files…
Previously we solved these with an iisreset and by deleting the temporary files compiled by ASP.NET. The fact we had these errors at all is probably a sign of a ppor solution structure or a problematic design (Scott mentions circular references. We had this problem a lot with a project that had a number of ASCXs in sub-directories that relied on a master page in another directory that were all used in a main ASPX page, as well as having ASCXs registered in web.config), but I guess it should either work or fail with a decent error message instead of having intermittent breaks. Nice to have the issue resolved :)

Comments