我的WCF客户端有几个问题,因为client.cs是空的,我在构建上遇到的唯一错误是无用的通用消息:
严重性代码描述项目文件行抑制状态
警告自定义工具警告:无法导入WSDL:PORTTYPE
详细信息:运行WSDL导入扩展时抛出了一个例外:System.ServiceModel.Description.DatacontractSerializerizErizErizersageContractImmporter
错误:位置的组件的清单定义与汇编引用不匹配。 (Hresult的例外:0x80131040)
xpath到错误来源://wsdl:definitions [@targetNamespace='http://tempuri.org/' ]/wsdl:porttype [@name ='ibrokerwcf'] myweb.setup c: 3.x \ myweb v3.x \ myweb.setup \ serviceco点\ brokerwcfsvc \ reference.svcmap 1
当我将服务加载到WCF测试客户端中时,所有广告上的async方法错误出现了(请参阅图像) WCF测试客户端中不支持它,因为它使用type system.threading.tasks.task'1“
所有这些先前工作正常。不确定是什么改变将其全部发送。
I'm having several issues with my WCF client in that the client Reference.cs is empty and the only error I get on the build is the useless generic message:
Severity Code Description Project File Line Suppression State
Warning Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IBrokerWcf'] MyWeb.Setup C:\Users\me\Projects\MyWeb 3.x\MyWeb v3.x\MyWeb.Setup\Service References\BrokerWcfSvc\Reference.svcmap 1
When I load the Service in the WCF Test Client, all of the advertised async methods error out (see image) with "This Operation is not supported in the WCF Test Client because it uses type System.Threading.Tasks.Task'1"
All of this previously worked fine. Not sure what changed to send it all sideways.

发布评论
评论(1)
正如错误所说,定位组件的清单定义与组件参考不符。
您需要检查组件。添加服务参考时,您是否单击“引用组件中的重用类型”。
您看到的“错误”只是Visual Studio随附的测试工具的限制,这两个功能都调用相同的服务器端函数支持。
error:不支持在WCF测试客户端中,因为它使用type system.threading.tasks
As the error says, the manifest definition of the locating assembly does not match the assembly reference.
You need to check the components. Did you click "Reuse types in referenced assemblies" when adding a service reference.
The "error" you are seeing is just a limitation of the test tool that comes with visual studio, both functions call the same server side function so there is no compelling force to make Microsoft add support. There is no actual error. If you really want to test the async version you will need to write your own test client that calls the function.
Error : not supported in WCF Test client because it uses type System.Threading.Tasks