ASP.NET 2.0 Fix That Everyone Needs
This entry is much like the one from Aug 2003 where I mentioned important fixes that everyone should install for ASP.Net 1.1. This time however we are talking ASP.NET 2.0. In the last couple of months there has been a rash of problems with CodeDom, specifically one issue has been the Achilles heal for ASP.NET support and it is documented in 915782.
915782 FIX: You may receive an InvalidCastException error in an ASP.NET-connected Web application
There is one workaround for this issue other than installing the fix and that is to disable batch compilation. Bummer this did not make it into the KB.
To disable batch compilation make the following setting in your web.conf file:
<compilation batch="false"/>
Of course you do not really want to run in production with this setting but if your issue stops after making this change it will confirm you are running into the same issue that we addressed in 915782.
Happy ASP.Netin'