WCF参考VS2015错误

时间:2016-05-24 11:01:43

标签: wcf reference visual-studio-2015

今天早上,我收到有关WCF参考的奇怪错误 enter image description here

Reference.svcmap: Failed to generate code for the service reference 'WCFEnrolments'.  Cannot import wsdl:portType  Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter  Error: Exception has been thrown by the target of an invocation.  XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IEnrolments']  Cannot import wsdl:binding  Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.  XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IEnrolments']  XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='BasicHttpBinding_IEnrolments']  Cannot import wsdl:port  Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.  XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='BasicHttpBinding_IEnrolments']  XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='Enrolments']/wsdl:port[@name='BasicHttpBinding_IEnrolments']       App_WebReferences/WCFEnrolments/    

我在互联网上进行了研究,在WCF配置中取消选中“在引用的程序集中重用类型”,现在一切正常,它可以编译而没有任何错误。

但问题是它影响了所有项目(我有大约15个项目,每个项目有5-7个WCF参考)我已经完成了。我甚至无法运行/编译一个项目,这些项目一切正常,直到昨晚。

无论如何要快速解决这个问题,而不是进入每个服务引用并取消勾选该特殊复选框?我确实安装了工具 - 扩展和更新中显示的所有更新,问题仍然存在。

我正在使用...... Microsoft Visual Studio Professional 2015 版本14.0.25123.00更新2 Microsoft .NET Framework 版本4.6.01055

1 个答案:

答案 0 :(得分:-1)

简单地取消引用程序集中的"重用类型"

enter image description here