无法加载文件或程序集“Microsoft.P​​ractices.EnterpriseLibrary.Common”或它的一个依赖 [英] Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common' or one of its dependencies

查看:1638
本文介绍了无法加载文件或程序集“Microsoft.P​​ractices.EnterpriseLibrary.Common”或它的一个依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已搜查谷歌,这和找不到解决问题的办法。

我的网站引用DAL(自定义DLL),它引用企业库数据访问组件。

我从的NuGet包管理器,当我尝试建立这个网站编译错误弹出添加企业库


  

错误44未能加载文件或程序集Microsoft.P​​ractices.EnterpriseLibrary.Common或它的一个依赖。找到的程序集清单定义不匹配程序集引用


我已经尝试设置复制本地=真在DAL为企业库dll文件和DLL文件与 DAL DLL 传送到网站的bin目录一起,但还是错误弹出。

任何人都可以指导我在这....


解决方案

的问题是,您正在使用的DLL并在您的项目中引用一个是不同的。我不知道在清单的区别是什么,但它可能是版本和/或公共密钥。

您有几件事情尝试:

在您的项目

1)打开该DLL的参考属性和特定的版本为false。

2)拆下参考,删除bin文件夹中的DLL,并重新添加引用。

3)你也可以在你的GAC不同的/不正确的版本。为了确保你总是使用一个特定的,已知的版本创建一个组件文件夹与您的项目目录,将DLL复制到该目录中,并在GAC或其他地方添加引用的组件目录下的DLL而不是一个你的机器上。这将确保只有您已经针对应用程序的特定版本将被使用,而不是在稍后的时间更新您的计算机上的任何版本。

I have searched google for this and could not find the solution to the problem.

My Website references DAL (custom dll) which references Enterprise Library Data Access Components.

I have added the Enterprise Library from the NuGet Package Manager and when I try to build the Website this compilation error pops up:

Error 44 Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference

I have tried setting the Copy Local = True in the DAL for the Enterprise Library dlls and the dlls are transferred to the Bin directory of the website along with DAL dll, but still the error pops up.

Can anyone guide me on this....

解决方案

The problem is that the DLL that you are using and the one that is referenced in your project are different. I'm not sure what the difference in the manifest is, but it could be version and/or public key.

You have a couple of things to try:

1) Open the properties for the DLL reference in your project and set Version Specific to false.

2) Remove the reference, delete the DLL from the bin folder, and re-add the reference.

3) You could also have a different/incorrect version in your GAC. In order to make sure that you are always using a specific, known version create an assemblies folder relative to your project directory, copy the dll to that directory, and add a reference to the DLL in the assemblies directory rather than one in GAC or elsewhere on your machine. This will ensure that only the specific version that you have targeted for the application will be used rather than any version that is updated on your machine at a later time.

这篇关于无法加载文件或程序集“Microsoft.P​​ractices.EnterpriseLibrary.Common”或它的一个依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆