Reference.svcmap:无法加载文件或程序Microsoft.P​​ractices.ServiceLocation,版本= 1.0.0.0 [英] Reference.svcmap: Could not load file or assembly Microsoft.Practices.ServiceLocation, Version=1.0.0.0

查看:2658
本文介绍了Reference.svcmap:无法加载文件或程序Microsoft.P​​ractices.ServiceLocation,版本= 1.0.0.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的web表单网站项目。该项目采用微软应用程序块的统一3.5 (DI容器),通过添加的NuGet

I have a simple webforms website project. The project uses Microsoft Application Block Unity 3.5 (DI Container) added via NuGet.

现在我用这个第三方Web服务。之后,我添加服务引用,并建立我得到这样的:

Now I am using this 3rd party web service. After I add Service Reference and build I get this:

错误19 Reference.svcmap:无法加载文件或程序
  Microsoft.P​​ractices.ServiceLocation,版本= 1.0.0.0,
  文化=中性公钥= 31bf3856ad364e35'或一个其
  依赖。找到的程序集清单定义不
  匹配程​​序集引用。 (从HRESULT异常:
  0x80131040)App_WebReferences / MyExternalService /

Error 19 Reference.svcmap: Could not load file or assembly 'Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) App_WebReferences/MyExternalService/

因此​​,我安装Microsoft.P​​ractices.ServiceLocation,但它仍然保持在抱怨该程序集。

So I installed Microsoft.Practices.ServiceLocation but it still keeps complaining about that assembly.

我尝试添加这我的web.config,但仍然无法正常工作。

I tried adding this to my web.config but still doesn't work.

 <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Practices.Unity" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.0.0.0" newVersion="1.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>

当我卸载统一包装,一切都很好。没有错误,我可以使用服务代理

As soon as I uninstall Unity package, all is good. No errors and I can use the Service proxy

试过干净的构建等,但没有任何工程。

Tried Clean Build, etc. but nothing works.

任何想法?

推荐答案

我是获取参考Microsoft.P​​ractices.ServiceLocation安装错误的包

I was installing wrong package for getting reference to Microsoft.Practices.ServiceLocation

错包

Wrong package:

正确的包是:

Correct package is:

这篇关于Reference.svcmap:无法加载文件或程序Microsoft.P​​ractices.ServiceLocation,版本= 1.0.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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