2009-08-07 123 views
4

這一直困擾着我,而現在的一個:無法加載文件或程序集「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. 
+0

我忘了提,我們使用單獨的庫的代碼,而不是usnig App_Code文件夾中。我的項目中的App_Code文件夾是空的。 – Andreas 2009-08-07 21:02:31

+0

該解決方案還包括一個使用MVC構建的子網站,所以它的混合asp.net常規窗體和asp.net mvc。 – Andreas 2009-08-08 08:38:35

回答

0

這個錯誤是由於web.config引用了一個類的錯誤包。週末清理頭腦,問題很容易解決。

+3

你能詳細告訴我什麼程序集被錯誤地引用嗎?我面臨同樣的問題。需要你的幫助... – 2012-09-10 04:57:14

+1

爲什麼你沒有告訴我們錯誤地引用了什麼程序集! ..我認爲你可以做到這一點,沒有很大的努力! – 2015-06-01 14:20:17

0

這僅僅是一個在黑暗中刺,但也許你的IIS上的ASP.Net安裝存在問題。嘗試打開Visual Studio命令提示符並運行

aspnet_regiis -i 

這將重新安裝ASP.Net到IIS中。

+1

感謝您的回覆。不過,我已經嘗試重新安裝ASP.NET,並沒有幫助。這將是不得不重新安裝環境,因爲找出實際發生的事情會很有趣。 – Andreas 2009-08-08 08:37:59

0

當我第一次嘗試使用「Publish ...」選項部署最近升級的應用程序(vs2008到vs2010)並且沒有要求刪除原始內容時,發生了這個錯誤。

0

我在嘗試發佈時遇到此錯誤。

嘗試禁用您的防病毒軟件。

這個工作適合我!

2

如果您使用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"/> 
相關問題