簡體   English   中英

C#無法加載文件或程序集'Microsoft.Practices.EnterpriseLibrary.Logging

[英]C# Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Logging

我正在使用ASP / C#網頁。 將頁面移到服務器時提交頁面時出現此錯誤,但是在本地計算機上測試頁面時卻沒有得到。 我試圖查找一些東西,但我認為沒有得到非常明確的答案。 請讓我知道如何解決此問題。

Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=e44a2bc38ed2c13c' 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 'Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=e44a2bc38ed2c13c' or one of its dependencies. The system cannot find the file specified.

Source Error: 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=e44a2bc38ed2c13c' 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].

來源: 異常,缺少Microsoft.Practices.EnterpriseLibrary.Common.dll。

問題是 -

企業庫程序集引用屬性未標記為“本地復制”

[如果使用的是Visual Studio或類似的工具:]選擇實際使用的第三方dll,然后轉到屬性並將CopyLocal設置從False更改為True。 這樣可以解決您的問題。

您需要添加二進制文件的引用。 從安裝了EnterpriseLibrary的系統中復制二進制文件,並將其添加為參考。

您將需要參考您的圖書館。 每當您要在項目中使用任何第三方dll時,最好將其放在項目中的依賴文件夾中。 嘗試從該依賴項文件夾中添加引用,以便在將項目交付到另一台計算機上時,無需擔心安裝和查找單個dll的麻煩。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM