Reference.svcmap:无法加载文件或程序集 Microsoft.Practices.ServiceLocation,版本 = 1.0.0.0 [英] Reference.svcmap: Could not load file or assembly Microsoft.Practices.ServiceLocation, Version=1.0.0.0
问题描述
我有一个简单的 webforms 网站项目.该项目使用通过 NuGet 添加的 Microsoft Application Block Unity 3.5(DI 容器).
I have a simple webforms website project. The project uses Microsoft Application Block Unity 3.5 (DI Container) added via NuGet.
现在我正在使用这个 3rd 方网络服务.添加服务引用并构建后,我得到了这个:
Now I am using this 3rd party web service. After I add Service Reference and build I get this:
错误 19 Reference.svcmap:无法加载文件或程序集'Microsoft.Practices.ServiceLocation,版本=1.0.0.0,Culture=neutral, PublicKeyToken=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.Practices.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>
我一卸载 Unity 包,一切都很好.没有错误,我可以使用服务代理
尝试过 Clean Build 等,但没有任何效果.
Tried Clean Build, etc. but nothing works.
有什么想法吗?
推荐答案
我安装了错误的包以获得对 Microsoft.Practices.ServiceLocation 的引用
I was installing wrong package for getting reference to Microsoft.Practices.ServiceLocation
错误的包:
正确的包是:
这篇关于Reference.svcmap:无法加载文件或程序集 Microsoft.Practices.ServiceLocation,版本 = 1.0.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!