views:

1531

answers:

3

This has been bothering me for a while now:

Could not load file or assembly 'app_code' or one of its dependencies. 
The system cannot find the file specified.

I'm using visual studio 2008 and IIS6 and for some reason I get this weird error.

Why is it trying to load 'app_code', and why does it fail?

Tried to resolve it/ find out more using the information in the exception

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

But that didn't help, neither did the information in the msdn article about the Assembly Binding Log Viewer: (http://msdn.microsoft.com/en-us/library/e74a18c4.aspx)

Anyone can shine a light on this abomination? I'm guessing this is a newbie mistake but I have no idea where to look now. Could it be IIS 6.0 configuration issue? I am using Windows XP Professional Edition and Visual Studio 2008.

A: 

This is just a stab in the dark, but maybe there's a problem with your ASP.Net installation on your IIS. Try opening a Visual Studio command prompt and running

aspnet_regiis -i

This will reinstall ASP.Net into IIS.

womp
Thanks for reply. However I have already tried reinstalling the ASP.NET like that, and it did not help. It would suck to have to reinstall the environment, since It would be interesting to find out whats actually going on.
junior
A: 

After getting the Assembly binding monitor up, it spews out something like:

LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Projects\NNNNNN\src\Trunc\Web\web.config
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: Microsoft.VisualStudio.Web, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/d94fb3b9/d76068ec/Microsoft.VisualStudio.Web.DLL.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/d94fb3b9/d76068ec/Microsoft.VisualStudio.Web/Microsoft.VisualStudio.Web.DLL.
LOG: Attempting download of new URL file:///C:/Projects/NNNNNN/src/Trunc/Web/bin/Microsoft.VisualStudio.Web.DLL.
LOG: Attempting download of new URL file:///C:/Projects/NNNNNN/src/Trunc/Web/bin/Microsoft.VisualStudio.Web/Microsoft.VisualStudio.Web.DLL.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/d94fb3b9/d76068ec/Microsoft.VisualStudio.Web.EXE.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/d94fb3b9/d76068ec/Microsoft.VisualStudio.Web/Microsoft.VisualStudio.Web.EXE.
LOG: Attempting download of new URL file:///C:/Projects/NNNNNN/src/Trunc/Web/bin/Microsoft.VisualStudio.Web.EXE.
LOG: Attempting download of new URL file:///C:/Projects/NNNNNN/src/Trunc/Web/bin/Microsoft.VisualStudio.Web/Microsoft.VisualStudio.Web.EXE.
LOG: All probing URLs attempted and failed.
junior
A: 

This error was due to web.config was referencing the wrong package for a class. Clearing the mind over the weekend, and problems are solved easily.

junior