title: C# HttpClient doesnt resolve host when used from Web Api project
body: <p><strong>The problem</strong>:</p>
  
  <p>In a WebApi controller i am trying to make a http request to another website using HttpClient - But it allways fails, and says that the host doesnt respond, or that it failed to setup a connection. </p>
  
  <p><strong>How to reproduce:</strong></p>
  
  <p>In Visual Studio (Enterprise on this end) 2017, Create a new Project using the Azure Web Api Template (File -> new -> Project -> ASP.NET Web Application (.NET Framework) -> Ok -> Azure Web Api. </p>
  
  <p>Make sure .NET Framework 4.7.1 is selected. (I have not tested with any other frameworks except .net core)</p>
  
  <p>In the ValuesController, from the Get method, make a call to any URL and try to respond with the Result StatusCode. </p>
  
  <p><strong>Code:</strong>: </p>
  
  <pre><code>public class ValuesController : ApiController
  {
      // GET api/values
      [SwaggerOperation("GetAll")]
      public IEnumerable&lt;string&gt; Get()
      {
          using (var client = new HttpClient())
          {
              var result = client.GetAsync("https://www.google.com").Result;
              return new string[] { result.StatusCode.ToString(), "value2" };
          }
      }
  }
  </code></pre>
  
  <p><strong>Debugging:</strong></p>
  
  <ul>
  <li>I created a separate Console Application, and did the same thing there. [Works]</li>
  <li>I created a separate .net core web api project, and did the same thing there. [Works]</li>
  </ul>
  
  <p>I did a fair bit of searching around this error, but with no result on my end. </p>
  
  <p>Any tips? </p>
  
  <p><strong>Exception Details:</strong></p>
  
  <pre><code>System.AggregateException occurred
    HResult=0x80131500
    Message=One or more errors occurred.
    Source=&lt;Cannot evaluate the exception source&gt;
    StackTrace:
     at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
     at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
     at System.Threading.Tasks.Task`1.get_Result()
     at WebApplication2.Controllers.ValuesController.Get() in C:\Users\&lt;user&gt;\documents\visual studio 2017\Projects\WebApplication2\WebApplication2\Controllers\ValuesController.cs:line 19
     at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.&lt;&gt;c__DisplayClass10.&lt;GetExecutor&gt;b__9(Object instance, Object[] methodParameters)
     at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
     at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
  
  Inner Exception 1:
  HttpRequestException: An error occurred while sending the request.
  
  Inner Exception 2:
  WebException: Unable to connect to the remote server
  
  Inner Exception 3:
  SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 216.58.209.99:443
  </code></pre>