Monday, June 23, 2014

IIS Could not load file or assembly 'App_Web_..., Version=0.0.0.0

Message

Could not load file or assembly 'App_Web_..., Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.


Context

Opening an ASP.NET page on a IIS web server.


Explanation

An unhandled exception occurred during the execution of the current web request. Precisely a System.IO.FileNotFoundException. This error may happen when the website is trying to load a custom web control that is displayed as needed. When the framework try to compile it, appends a random string at the end of the assemby. If another control referes to this one, at compile time the name of the newly compiled file and the previous version of the file cause a file name mismatch and therefore the parent control is looking for a file that no longer exists.


Solution

Setting the batch property of the compilation tag to false in the web.config file:

<compilation debug="false" batch="false" />


No comments:

Post a Comment