Please don\'t close as duplicate until you read the question to the end; I already googled for hours without success.
EDIT: Now I\'m convinced it\'s related to
To resolve this error, simply close the Channel Factory as well.
private async Task TestTask()
{
Service1Client proxy = null;
try
{
Console.WriteLine("Calling service");
proxy = new Service1Client();
return await proxy.DoWorkAsync();
}
finally
{
if (proxy.State != System.ServiceModel.CommunicationState.Faulted)
{
Console.WriteLine("Closing client");
proxy.ChannelFactory.Close();
proxy.Close();
}
else
{
Console.WriteLine("Aborting client");
proxy.Abort();
}
}
}