No connection could be made because the target machine actively refused it?

后端 未结 28 2234
北荒
北荒 2020-11-22 01:27

Sometimes I get the following error while I was doing HttpWebRequest to a WebService. I copied my code below too.


System.Net.WebException: Unable to connect         


        
28条回答
  •  失恋的感觉
    2020-11-22 01:50

    In my case this was caused by a faulty deployment where a setting in my web.config was not made.

    A collegue explained that the IP address in the error message represents the localhost.

    When I corrected the web.config I was then using the correct url to make the server calls and it worked.

    I thought I would post this in case it might help someone.

提交回复
热议问题