If you encounter an issue browsing to a site collection that causes total failure with the message shown below, follow these steps to correct the issue.
This issue may present itself in these situations:
- It appears immediately while debugging from Visual Studio, then in all subsequent browsing to any site collection in the web application in question.
- The issue goes away after running the Configuration Wizard, rebuilding the web application or re-installing SharePoint. After this, sites can be browsed but the issue recurs upon the first debug of a solution through Visual Studio, then in all subsequent browsing.
To correct this issue, open the web.config file for the web application in question. Look for the following tag:
<compilation batch="false" debug="true"
This tag will likely be about half-way through the web.config file in an ordinary web part project.
Change the optimizeCompilations attribute value from true to false.
The change should take effect immediately. No restart should be required.