Friday, 1 February 2008

Could not load file or assembly App_Web_XXX

Came across a completely random exception today on a new web server:

System.IO.FileNotFoundException: Could not load file or assembly 'App_Web_XXX, Version=, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'App_Web_XXX, Version=, Culture=neutral, PublicKeyToken=null'

After some digging, I found issue is now resolved in .Net 2 SP1, which I recommend you all download if you haven't done so already. You can alternatively download the individual fix for this from Microsoft Support. If you are unable to install the fix or service pack there are a couple of workarounds that may work:

1. Editing the aspx file throwing the error (if appropriate)
2. Clear the Temporary ASP.Net Files folder and restart the application pool
3. Setting batch="false" in the web.config file compilation section (it is true by default)

All the workarounds are fairly simple and harmless except option 3. This has other performance implications; therefore may not be the best option for a production environment.


ritesh said...

It might be due to something with framework.
so can get hotfix 915782. It may resolve this issue. Here's the article:

Ritesh Ravlani

Neil kilbride said...

I think that was also resolved in the .Net 2 SP1 download too - which most of us should have now :)

Thanks Ritesh.

Anonymous said...