WCF异步Web服务问题

发布于 2025-02-11 00:37:14 字数 779 浏览 0 评论 0 原文

我的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.

WCF Test Client

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

总以为 2025-02-18 00:37:14

System.ServiceModel.Description.DatacontractserializerizersageContractImmporter
错误:位置的组件的清单定义与
组装参考。

正如错误所说,定位组件的清单定义与组件参考不符。
您需要检查组件。添加服务参考时,您是否单击“引用组件中的重用类型”。

WCF测试客户端不支持此操作,因为它使用
type System.Threading.tasks.task'1“

您看到的“错误”只是Visual Studio随附的测试工具的限制,这两个功能都调用相同的服务器端函数支持。
error:不支持在WCF测试客户端中,因为它使用type system.threading.tasks

System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: The located assembly's manifest definition does not match the
assembly reference.

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.

This Operation is not supported in the WCF Test Client because it uses
type System.Threading.Tasks.Task'1"

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文