无法加载文件或程序集“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'

查看:2815
本文介绍了无法加载文件或程序集“Microsoft.Practices.EnterpriseLibrary.Data,Version = 5.0.414.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将项目与另一个项目(MVC3应用程序)集成。然后我得到下面的错误。
这两个项目都可以正常工作,使用 Microsoft Enterprise Library 5.2.414.0 。在集成之后,只有一些页面正在工作,剩下的页面抛出异常。


无法加载文件或程序集
'Microsoft .Practices.EnterpriseLibrary.Data,Version = 5.0.414.0,
Culture = neutral,PublicKeyToken = 31bf3856ad364e35'或其
依赖关系之一。系统找不到指定的文件。



解决方案

通常如果引用没有CopyLocal标志设置为true。



要解决:


  1. 打开您的解决方案

  2. 展开,直到找到您的项目

  3. 展开参考

  4. 选择上述的程序集

  5. 右键单击并按属性(或按F4)

  6. 其中Copy local将其设置为true

  7. <另外,如果您缺少上述程序集所需的其他企业库块(并复制本地的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


    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:

    1. Open your solution
    2. Expand until you find your project
    3. Expand references
    4. Select the mentioned assembly
    5. Right-click and press properties (or press F4)
    6. Where it says "Copy local" set it to true

    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.Common.dll
    • Microsoft.Practices.ServiceLocation.dll
    • Microsoft.Practices.Unity.Configuration.dll
    • Microsoft.Practices.Unity
    • Microsoft.Practices.Unity.Interception.Configuration
    • Microsoft.Practices.Unity.Interception

    这篇关于无法加载文件或程序集“Microsoft.Practices.EnterpriseLibrary.Data,Version = 5.0.414.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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