I added a link to the WCF service to my .NET 4.5 application using the option "Generate task-based operations" by default, "Allow the generation of asynchronous operations." I call the service from my own async method, sort of like:
public async Task<SomeData> GetDataAsync()
{
var client = new MyServiceClient();
var result = await client.GetSomeDataAsync();
return result;
}
await client.GetSomeDataAsync()never ends (the breakpoint in the return statement never hits), and I don't get a timeout or any other error, no exception is thrown, nothing. Fiddler shows that the client sent the request and the service responded almost instantly with the expected data, so the problem is on my side of the fence somehow.
If I switch to the synchronous version instead
var result = client.GetSomeData();
The call returns as expected.
What am I doing wrong?