无法加载文件或程序集“Microsoft.Practices.EnterpriseLibrary.Data,Version = 5.0.414.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35' [英] Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
问题描述
这两个项目都可以正常工作,使用 Microsoft Enterprise Library 5.2.414.0 。在集成之后,只有一些页面正在工作,剩下的页面抛出异常。
无法加载文件或程序集
'Microsoft .Practices.EnterpriseLibrary.Data,Version = 5.0.414.0,
Culture = neutral,PublicKeyToken = 31bf3856ad364e35'或其
依赖关系之一。系统找不到指定的文件。
通常如果引用没有CopyLocal标志设置为true。
要解决:
- 打开您的解决方案
- 展开,直到找到您的项目
- 展开参考
- 选择上述的程序集
- 右键单击并按属性(或按F4)
- 其中Copy local将其设置为true
- Microsoft.Practices.EnterpriseLibrary.Common.dll
- Microsoft.Practices.ServiceLocation.dll
- Microsoft.Practices.Unity.Configuration.dll
- Microsoft.Practices.Unity
- Microsoft.Practices.Unity.Interception.Configuration
- Microsoft.Practices.Unity.Interception
- Open your solution
- Expand until you find your project
- Expand references
- Select the mentioned assembly
- Right-click and press properties (or press F4)
- Where it says "Copy local" set it to true
- Microsoft.Practices.EnterpriseLibrary.Common.dll
- Microsoft.Practices.ServiceLocation.dll
- Microsoft.Practices.Unity.Configuration.dll
- Microsoft.Practices.Unity
- Microsoft.Practices.Unity.Interception.Configuration
- Microsoft.Practices.Unity.Interception
<另外,如果您缺少上述程序集所需的其他企业库块(并复制本地的true),也可能会发生这种情况,这些块是:
I have integrated my project with another one (MVC3 application). Then I'm getting below error. Both the projects are working fine with the Microsoft Enterprise Library version 5.2.414.0. After integrating only some of the pages are working and remaining pages throwing below exception.
Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
This usually happens if the reference does not have "CopyLocal" flag set to true.
To solve:
Also, this can happen if you are missing the other enterprise library blocks needed by the mentioned assembly (and copy local true as well), which are:
这篇关于无法加载文件或程序集“Microsoft.Practices.EnterpriseLibrary.Data,Version = 5.0.414.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!