简体   繁体   English

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

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

I am working with an ASP/C# web page. 我正在使用ASP / C#网页。 I am getting this error when submitting the page when I moved it to a server, but was not getting it when I was testing it on my local machine. 将页面移到服务器时提交页面时出现此错误,但是在本地计算机上测试页面时却没有得到。 I tried to look up a few things, but I was not getting a very clear answer in my opinion. 我试图查找一些东西,但我认为没有得到非常明确的答案。 Please let me know how to fix this.. 请让我知道如何解决此问题。

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

source: Exception saying missing Microsoft.Practices.EnterpriseLibrary.Common.dll. 来源: 异常,缺少Microsoft.Practices.EnterpriseLibrary.Common.dll。

The problem is - 问题是 -

the enterprise library assembly reference propertiesare not marked "copy local" 企业库程序集引用属性未标记为“本地复制”

[If you're using Visual Studio or something similar:] select the actual third party dll you are using, then go to properties and change the CopyLocal setting from False to True. [如果使用的是Visual Studio或类似的工具:]选择实际使用的第三方dll,然后转到属性并将CopyLocal设置从False更改为True。 This should resolve your issue. 这样可以解决您的问题。

You need to add the reference of binary. 您需要添加二进制文件的引用。 Copy the binary somewhere on your system from where EnterpriseLibrary installed and add it as reference. 从安装了EnterpriseLibrary的系统中复制二进制文件,并将其添加为参考。

You will need reference of your library. 您将需要参考您的图书馆。 It is good that you place on dependency folder in your project when ever you are going to use any third party dll in your project. 每当您要在项目中使用任何第三方dll时,最好将其放在项目中的依赖文件夹中。 Try adding reference from that dependency folder, so when you ship your project in another machine you don't need to worry for installing and finding individual dll. 尝试从该依赖项文件夹中添加引用,以便在将项目交付到另一台计算机上时,无需担心安装和查找单个dll的麻烦。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法加载文件或程序集'Microsoft.Practices.EnterpriseLibrary.Logging - Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Logging C#Microsoft.Practices.EnterpriseLibrary.Logging错误 - C# Microsoft.Practices.EnterpriseLibrary.Logging error 无法加载文件或程序集Microsoft.Practices.EnterpriseLibrary.Configuration - Could not load file or assembly Microsoft.Practices.EnterpriseLibrary.Configuration “无法加载文件或程序集'Microsoft.Practices.EnterpriseLibrary.Validation”异常 - “Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Validation” exception 无法加载文件或程序集'Microsoft.Practices.EnterpriseLibrary.Caching - Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Caching 无法在WCF中加载文件或程序集'Microsoft.Practices.EnterpriseLibrary.Common - Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common in WCF 无法加载文件或程序集“Microsoft.Practices.EnterpriseLibrary.Common”或其依赖项之一 - Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common' or one of its dependencies 使用 Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener 在 C# app.config 中的文件名中附加日期 - appending date in filename in C# app.config using Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener 无法加载文件或程序集“Microsoft.Practices.EnterpriseLibrary.Common,Version=6.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”或 - Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or C#无法加载文件或程序集“Microsoft.SharePoint.Library” - C# Could not load file or assembly 'Microsoft.SharePoint.Library'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM