Cannot have two operations in the same contract with the same name (Async & Non)

后端 未结 5 1614
被撕碎了的回忆
被撕碎了的回忆 2021-01-01 15:15

I get the following exception (Cannot have two operations in the same contract with the same name, methods ExecuteAsync and Execute) when the following service is activated.

5条回答
  •  有刺的猬
    2021-01-01 16:12

    Async methods are a .NET construct. The Web Services standard does not know about them. You do not need to do anything to enable clients to use async operations because server and client are independent. Pick sync or async independently for client and server.

    Since this fact often results in disbelief let me state the following: You can have a sync server with an async client and the other way around.

提交回复
热议问题