无法加载文件或程序集“App_Code文件”或一个依赖
这一直困扰着我,而现在的一个:无法加载文件或程序集“App_Code文件”或一个依赖
Could not load file or assembly 'app_code' or one of its dependencies.
The system cannot find the file specified.
我使用Visual Studio 2008和IIS6出于某种原因,我得到这个奇怪的错误。
它为什么要加载'app_code',为什么它会失败?
试图解决它/找出更多使用信息,在异常
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].
但是这并没有帮助,也没有MSDN文章有关程序集绑定日志查看器中的信息:(http://msdn.microsoft.com/en-us/library/e74a18c4.aspx)
任何人都可以照射这种可憎的东西吗?我猜这是一个新手的错误,但我现在不知道该去哪里看。它可能是IIS 6.0配置问题?我使用Windows XP专业版和Visual Studio 2008
获得大会结合起来监视后,它喷出了像:
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.
这个错误是由于web.config引用了一个类的错误包。周末清理头脑,问题很容易解决。
你能详细告诉我什么程序集被错误地引用吗?我面临同样的问题。需要你的帮助... – 2012-09-10 04:57:14
为什么你没有告诉我们错误地引用了什么程序集! ..我认为你可以做到这一点,没有很大的努力! – 2015-06-01 14:20:17
这仅仅是一个在黑暗中刺,但也许你的IIS上的ASP.Net安装存在问题。尝试打开Visual Studio命令提示符并运行
aspnet_regiis -i
这将重新安装ASP.Net到IIS中。
感谢您的回复。不过,我已经尝试重新安装ASP.NET,并没有帮助。这将是不得不重新安装环境,因为找出实际发生的事情会很有趣。 – Andreas 2009-08-08 08:37:59
当我第一次尝试使用“Publish ...”选项部署最近升级的应用程序(vs2008到vs2010)并且没有要求删除原始内容时,发生了这个错误。
我在尝试发布时遇到此错误。
尝试禁用您的防病毒软件。
这个工作适合我!
如果您使用Visual Studio性能工具,那么Visual Studio可能会在web.config appsettings部分留下一个键。它会导致加载一个32位的库,如果您的应用程序以64位模式加载,这将不起作用。
检查以下内容并删除它:
<add key="Microsoft.VisualStudio.Enterprise.AspNetHelper.VsInstrLocation" value="C:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Performance Tools\vsinstr.exe"/>
我忘了提,我们使用单独的库的代码,而不是usnig App_Code文件夹中。我的项目中的App_Code文件夹是空的。 – Andreas 2009-08-07 21:02:31
该解决方案还包括一个使用MVC构建的子网站,所以它的混合asp.net常规窗体和asp.net mvc。 – Andreas 2009-08-08 08:38:35