title: localhost refused to connect in Webapi operation
body: <p>I have created WebApi project and include sample Get method.
  When I am trying to access the get method using url (<a href="http://localhost:port/api/video" rel="nofollow noreferrer">http://localhost:port/api/video</a>) from Firefox/Chrome browser I am getting below message:-</p>
  
  <p>This site can’t be reached
  localhost refused to connect.
  ERR_CONNECTION_REFUSED</p>
  
  <p>When I created ASP.NET web application and try to view aspx page using localhost in browser then it is showing the page. </p>
  
  <p>When I am trying to run WebAPI withing Visual Studio then it open the url(<a href="http://localhost:port" rel="nofollow noreferrer">http://localhost:port</a>) in Google Chrome with HTTP Error 403.14 - Forbidden error.</p>
  
  <p>I am using IIS Express with Visual Studio 2015 Community. OS is Windows 10.</p>
  
  <p>I have tried to turned off firewall and remove # from hosts.config file but it never worked.</p>
  
  <p>Is there anything that I can do because I am directionless now after looking out for same issue for last 2-3 days?</p>
  
  <p>Please find my code below:-</p>
  
  <p><strong>Global.asax.cs</strong></p>
  
  <pre><code> public class WebApiApplication : System.Web.HttpApplication
      {
          protected void Application_Start()
          {
              GlobalConfiguration.Configure(WebApiConfig.Register);
          }
      }
  </code></pre>
  
  <p><strong>VideoController.cs</strong></p>
  
  <pre><code>public class VideoController : ApiController
      {
          public IEnumerable&lt;string&gt; Get()
          {
              return new string[]{ "Value1", "Value2"};
          }
  }
  </code></pre>
  
  <p><strong>WebApiConfig.cs</strong></p>
  
  <pre><code>public static class WebApiConfig
      {
          public static void Register(HttpConfiguration config)
          {
              // Web API configuration and services
             // config.EnableCors();
              // Web API routes
              config.MapHttpAttributeRoutes();
  
              config.Routes.MapHttpRoute(
                  name: "DefaultApi",
                  routeTemplate: "api/{controller}/{id}",
                  defaults: new { id = RouteParameter.Optional }
              );
          }
      }
  </code></pre>