2013-08-27 124 views
0

我面臨着服務器上的問題,它是說System.Windows.dll找不到。在第一次執行時,它拋出異常,但刷新頁面後,它工作正常。無法加載文件或程序集「System.Windows,Version = 2.0.5.0,Culture = neutral,PublicKeyToken = 7cec85d7bea7798e」或其某個依賴項。

我想通了,這是因爲ScriptManager發生。我有我的ScriptManager網頁上,看到下面的錯誤:

Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified. 

Source Error: 


Line 148:  <img src="../../Images/loading.gif" width="500" /> 
Line 149: </div> 
Line 150: <asp:ScriptManager ID="ScriptManager1" runat="server"> 
Line 151: </asp:ScriptManager> 
Line 152: <table border="0" cellspacing="0" cellpadding="0" width="100%"> 


Source File: d:\xyz\CRM\Reports\zyz.aspx Line: 150 

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' could not be loaded. 


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]. 

回答

0

你會發現在引用文件夾中的DLL:

Copy local = true 

設置該屬性的組件。

構建,它應該工作。

如果不是:

副本這個dll到項目和設置複製到輸出目錄=複製如果新

編輯:

嘗試使用此的ScriptManager:

Download from here

ToolkitScriptManager

+0

感謝您的回覆。 – user2720652

+0

我試過這種方法,但System.Windows.dll作爲Silverlight解決方案中的參考而不是Web應用程序添加。我把它作爲Copy local = true。現在錯誤更改爲無法加載文件或程序集'System.Windows,版本= 5.0.5.0。此外,現在System.Windows.dll顯示在Silverlight bin文件夾中,但部署Web時。它不顯示在web的bin文件夾中。請回復 – user2720652

+0

也正如我在主要問題中提到的那樣,由於ScriptManager標記,此錯誤即將到來。如果我從我的頁面中刪除ScriptManager和UpdatePanel。它工作正常。我無法弄清楚它爲什麼會發生。 – user2720652

相關問題