title: AspNet Core application “The localhost page isn’t working” error
body: <p>I have an application developed in asp.net core with full .net framework (.Net 4.6.1). The application is created using Visual Studio 2017 RC. After successful compilation, it has generated TestApplication.exe. </p>
  
  <p>When I go to the project root directory and executes the command dotnet run, application is launched and starts listening on port 5000. Application runs fine using this method. However when I go to the <code>projectRoot\ bin\Debug\net461\</code>  and launch TestApplicatin.exe, it starts listening on port 5000 too but when I go to the browser and type <a href="http://localhost:5000" rel="noreferrer">http://localhost:5000</a> , I get the following error </p>
  
  <blockquote>
    <p>The localhost page isn’t working</p>
  </blockquote>
  
  <p>localhost is currently unable to handle this request.</p>
  
  <p>HTTP ERROR 500</p>
  
  <p><strong>Note</strong> - </p>
  
  <ol>
  <li>As of now I have not written any piece of code. Entire code is
  generated by Visual Studio after selecting asp.net core project template.</li>
  <li>I don't want to use IIS</li>
  </ol>
  
  <p>Please see the content of Program.cs file</p>
  
  <pre><code>public static void Main(string[] args)
      {
          var host = new WebHostBuilder()
              .UseKestrel()
              .UseContentRoot(Directory.GetCurrentDirectory())
              .UseIISIntegration()
              .UseStartup&lt;Startup&gt;()
              .Build();
  
          host.Run();
      }
  </code></pre>