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.
[ServiceContract]
public interface IMyService
{
[OperationContract]
byte[] Execute(MyRequest request);
[OperationContract]
Task<byte[]> ExecuteAsync(MyRequest request);
}
I guess this makes sense if you are using the svcutil.exe to create your service reference, because the task-based operations are created automatically for you. However, I don't want to add a service reference and instead just use the standard ChannelFactory to create the WCF Channel. Is there any other way this is possible without renaming the async method to something else? Or must I wrap the sync method on the client in a Task.Run?