system.net.webexception

System.Net.WebException: The remote name could not be resolved:

﹥>﹥吖頭↗ 提交于 2019-11-27 07:48:53
I am testing an endpoint that I am experiencing some issues with. I am simply using HttpClient in a loop that performs a request each hour. var httpClient = new HttpClient(); var message = httpClient.GetAsync(url).Result; Console.WriteLine(message.StatusCode); Once in a while I am getting this exception: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'xxx' The experience is that right after the exception, the URL can be accessed. In a browser you simply refresh the page and all is good. I

System.Net.WebException: The remote name could not be resolved:

早过忘川 提交于 2019-11-26 13:49:45
问题 I am testing an endpoint that I am experiencing some issues with. I am simply using HttpClient in a loop that performs a request each hour. var httpClient = new HttpClient(); var message = httpClient.GetAsync(url).Result; Console.WriteLine(message.StatusCode); Once in a while I am getting this exception: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'xxx' The experience is that right

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

痴心易碎 提交于 2019-11-26 03:13:21
问题 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 to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:80 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint