title: Windows 10 Visual Studio 2019 IIS Express won't start with error 500
body: <p>We have an API project in .Net Core 3.1.
  It is working in all the computers in the team but when tried to debug it on a new member computer it failed. 
  It states there is a server error (500) and won't start the program. 
  It works as a local service, without IIS. </p>
  
  <p><a href="https://i.stack.imgur.com/P3cGe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P3cGe.png" alt="VS Error"></a>
  <a href="https://i.stack.imgur.com/GVXzw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GVXzw.png" alt="Event Log Error"></a></p>
  
  <p>We have tried to format the computer and start fresh, with no use. 
  I saw posts relating to the project configurations and launch settings, but since it is working on other machines I don't think this is the issue. 
  We also tried to add the required lines for the aspnetcore modules in iis template files and the dlls as seen in other places where it was recommended, getting the same issue. </p>
  
  <p>Any suggestion will be appreciated!</p>
  
  <hr>
  
  <p><strong>Error text from your HttpFailure_08-24-17.tml file</strong></p>
  
  <p>NOTE: you really should have copied/pasted as text, instead of a attaching a screen shot:</p>
  
  <pre><code>The description for Event ID 1034 from source IIS Express AspNetCore Module V2 cannot found.  
  Either the component that raises this event is not installed on your local computer or the installation is corrupted. 
  You can install or repair the component on the local computer.
  ... 
  The following information was included with the event:
  
  Could not load configuration. Exception message: Unable to get required configuration section 'system.webServer/aspNetCore'.  Possible reason is web.config authoring error.
  
  The request is not supported.
  </code></pre>
  
  <hr>
  
  <p>EDIT:
  Program.cs:</p>
  
  <pre><code> public class Program
  {
      public static void Main(string[] args)
      {
          try
          {
              Console.Error.WriteLine("Starting application (from error log without errors)");
  
              var config = new ConfigurationBuilder().AddEnvironmentVariables("ASPNETCORE_").Build();
  
              Console.WriteLine("Config set");
  
              var hostBuilder = new WebHostBuilder()
                  .UseKestrel(opt =&gt; opt.AddServerHeader = false)
                  .UseConfiguration(config)
                  .UseContentRoot(Directory.GetCurrentDirectory())
                  .UseIISIntegration()
                  .UseStartup&lt;Startup&gt;();
  
              Console.WriteLine("hostBuilder set");
  
              // ConfigureServices is only used to delay execution until UseIISIntegration()
              // has actually set the "urls" setting.
  
              Console.WriteLine("urls for hostBuilder " + hostBuilder.GetSetting("urls"));
  
              hostBuilder.ConfigureServices(services =&gt;
              {
                  var urls = hostBuilder.GetSetting("urls");
                  urls = string.IsNullOrWhiteSpace(urls) ? "127.0.0.1" : urls.Replace("localhost", "127.0.0.1");
                  hostBuilder.UseSetting("urls", urls);
              });
  
              Console.WriteLine("hostBuilder.ConfigureServices set");
  
              var host = hostBuilder.Build();
  
              Console.WriteLine("host set");
  
              host.Run();
  
          }
          catch (Exception ex)
          {
              Console.Error.WriteLine(ex.Message);
          }
      }
  }
  </code></pre>