简体   繁体   English

从WCF中通过点网创建的getDataAsync函数获取错误

[英]Getting an error from a dot-net created function of getDataAsync in WCF

I have: 我有:

[OperationContract]
string GetData(string input);

I get an error saying cannot have two operations in the same contract with the same name, methods GetDataAsync and GetData in type....violate this rule 我收到一条错误消息,说cannot have two operations in the same contract with the same name, methods GetDataAsync and GetData in type....violate this rule

But I didn't configure any GetDataAsync function! 但是我没有配置任何GetDataAsync函数! So why is the async function being automatically created? 那么为什么要自动创建异步功能呢? How do I stop it (because I don't need that)? 如何停止它(因为我不需要那个)?

This occurs when you have methods [OperationContract] with same name, no matter if those methods receives different parameters, you can't name methods with same name. 当您具有名称相同的方法[OperationContract]时,就会发生这种情况,无论这些方法是否接收不同的参数,都无法使用相同的名称命名方法。

and the Ansy method is created automatically when you add the service reference, but you can uncheck this option in the service reference. 并且在添加服务参考时将自动创建Ansy方法,但是您可以在服务参考中取消选中此选项。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从动态 URL 中读取 JSON 并需要填充到 Dot-net Core MVC 下拉列表中 - Read JSON from Dynamic URL and need to populate in Dot-net Core MVC Dropdownlist C#/dot-NET 的字体渲染库? - Font rendering libraries for C# / dot-NET? 如何通过点网运行Selenium API(使用C#) - How to run selenium API with dot-net (using c#) PostAsync() 方法在 dot-net 核心窗口服务中不起作用 - PostAsync() method is not working in dot-net core window service 我尝试使用 dot-net 生成 X509Certificate2 密钥对,但缺少私钥 - I try to generate a X509Certificate2 key pair with dot-net but private key is missing 如何从dataPackageView.GetDataAsync()获取字符串 - How to get string from dataPackageView.GetDataAsync() 设计问题 - ORM 与 OOP 在 Dot-Net 3 层应用程序中 - 应该 object 保持自身或只有业务逻辑层应该调用 DAL - Design Question - ORM vs OOP in Dot-Net 3-tiered app -should an object persist itself or only business logic layer should call DAL 尝试使用 dot net core mvc 中的 open xml 下载 word 文档时出现错误 - trying to download the word document using open xml from dot net core mvc getting an error 从WCF函数返回DataContract时,出现此错误:“接收HTTP响应时发生错误” - While returning a DataContract from a WCF function, I'm getting this error: “An error occurred while receiving the HTTP response” NET WCF服务出现405响应错误 - 405 response error from .net WCF Service
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM