.NET装载寻找另一个版本装配时产生类型的的WCF服务 [英] .NET loaded looking for another version of assembly when generate type's for WCF service

查看:205
本文介绍了.NET装载寻找另一个版本装配时产生类型的的WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试添加服务引用到我的ASP.NET Web应用程序在Visual Studio 2013年我在我的项目有参考Microsoft.Owin.Security版本2.1.0.0得到这个错误。但我劝阻他为什么要找2.0.1.0版本?

  

无法导入WSDL:portType的详细信息:一个异常被抛出,而   运行WSDL导入扩展:   System.ServiceModel.Description.DataContractSerializerMessageContractImporter   错误:无法加载文件或程序集Microsoft.Owin.Security,   版本= 2.0.1.0,文化=中性公钥= 31bf3856ad364e35或   它的一个依赖。该系统找不到指定的文件。

解决方案

我没找到和发布可能的解决方案上的<一个href="http://stackoverflow.com/questions/26762478/net-loading-wrong-assembly-when-generating-service-reference">Hélder贡萨尔维斯的版本这个问题。的希望它可以让你生成服务引用不重定向到Microsoft.Owin.Security组件的旧版本。请让我知道这对你的作品。

每Rizier123建议,这里是从我的完整的解决方案的文字:

有完全相同的错误逐字,能够通过指定组件从重用类型来解决这个问题。

在添加服务引用,请点击高级... 添加服务引用窗口的左下角按钮。在服务参考设置显示,在数据类型部分,在所有引用的程序集在再利用类型的屏幕:复选框,选择在规定的基准组件在再利用类型单选按钮,然后只检查包含所使用的服务类型的组件。这应该可以解决这个问题。

I got this error while trying to add service reference to my ASP.NET web application in Visual Studio 2013. I had reference to Microsoft.Owin.Security version 2.1.0.0 in my project. But I'm discouraged why he looking for 2.0.1.0 version?

Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter Error: Could not load file or assembly 'Microsoft.Owin.Security, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

解决方案

I did find and post a possible solution on Hélder Gonçalves' version of this question. Hopefully it will allow you to generate the service reference without redirecting to an older version of the Microsoft.Owin.Security assembly. Please let me know if this works for you.

Per Rizier123 suggestion, here's the text from my solution in full:

Had the exact same error verbatim and was able to resolve it by specifying which assemblies to reuse types from.

When adding the service reference, click the Advanced... button in the bottom left corner of the Add Service Reference window. On the Service Reference Settings screen that appears, in the Data Type section, under the Reuse Types in all referenced assemblies: check-box, select the Reuse types in specified reference assemblies radio button then check ONLY the assemblies that contain types used by the service. This should resolve the issue.

这篇关于.NET装载寻找另一个版本装配时产生类型的的WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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