MS Load Test – System.IO.IOException Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host

Today I was tearing my hair out trying to figure out why my Web Performance Tests were not playing back correctly. Each run stubbornly displayed, ‘System.IO.IOException Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host’. Turns out that the WebTestRequest wasn’t issued with the correct https protocol. My fix for now is to place the following in the WebTest constructor;

 
public WebTestCoded()
{
     this.PreAuthenticate = true;
     this.Proxy = "default";
     ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s