繁体   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