0

I am making a Winforms app that must connect to a ASP.NET WebApi web service that I also made. When I connect to the web service from my computer the Winforms app works, but when I install the Winforms app on some computers it fails to connect to the web service with the following exception:

System.IO.IOException: Can not write data to the transport connection: The interruption of an existing connection has been forced by the remote host

The problem is that this error might be due to a connection error or due to bugs in either the Winforms app or the web service and I have no idea what might be the cause. I can connect to the server where the web service is hosted. Are there any server logs that I can use to see what might be the cause of this error and if there are, where do I check them?

awh112
  • 1,466
  • 4
  • 22
  • 34
Alejandro
  • 351
  • 4
  • 11
  • 1
    have you seen [this](https://stackoverflow.com/a/5420788/6144699)? maybe a firewall is blocking calls? – PSkalka May 31 '18 at 13:45
  • Can you make the same requests using the command-line tools `curl` or `wget` (you can get Windows versions)? That would help indicate if it's an issue with your code, Windows' HTTP client stack (proxy settings etc) or the computer's internet connection. – Dai May 31 '18 at 13:46
  • I can't install curl or wget on customers' computers. What command line program can I use that is installed with Windows instead? – Alejandro May 31 '18 at 14:11
  • If you're using PowerShell, Invoke-WebRequest/Invoke-Rest are similar – kͩeͣmͮpͥ ͩ May 31 '18 at 15:18
  • You can only capture network packets to see what really breaks the connection. https://blogs.technet.microsoft.com/netmon/2009/05/13/event-tracing-for-windows-and-network-monitor/ Once the packets are captured, use Network Monitor to analyze. – Lex Li May 31 '18 at 15:23
  • It seems that the issue is caused by the server rejecting TLS 1.0. How do I force IIS and the app to accept TLS 1.0 requests from Windows XP users? I need to support Windows XP. – Alejandro May 31 '18 at 20:10

0 Answers0