title: ASP.NET Core 5 WebAPI gives 404 not found error
body: <p>We have a very simple ASP.NET Core 5 Web API written in C#. Works fine on the dev machine and on the test server.</p>
  <p>Our Get Method simply returns a string value.</p>
  <ol>
  <li>We installed .NET hosting 5.0.11 bundle on Test Server.</li>
  <li>Created an App Pool (not managed) with service account as Identity</li>
  <li>Created Web App in IIS 10 with App Pool and HTTP binding port 99</li>
  </ol>
  <p>It works fine on the Test server. But when we follow the same steps on Production then I keep getting 404 not found error.</p>
  <p>I even tried the default <code>WeatherForecast</code> API. Even that is throwing same 404 not found error in Production.</p>
  <p>Here are contents of <code>web.config</code> and <code>Startup.cs</code> and <code>Program.cs</code>:</p>
  <p>web.config:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;configuration&gt;
      &lt;location path=&quot;.&quot; inheritInChildApplications=&quot;false&quot;&gt;
          &lt;system.webServer&gt;
              &lt;handlers&gt;
                  &lt;add name=&quot;aspNetCore&quot; path=&quot;*&quot; verb=&quot;*&quot; modules=&quot;AspNetCoreModuleV2&quot; resourceType=&quot;Unspecified&quot; /&gt;
              &lt;/handlers&gt;
              &lt;aspNetCore processPath=&quot;dotnet&quot; arguments=&quot;.\MVATest.dll&quot; stdoutLogEnabled=&quot;false&quot; stdoutLogFile=&quot;.\logs\stdout&quot; hostingModel=&quot;inprocess&quot; /&gt;
          &lt;/system.webServer&gt;
      &lt;/location&gt;
  &lt;/configuration&gt;
  &lt;!--ProjectGuid: f6bd6db8-d217-4d15-b1d3-06388fe80490--&gt;
  </code></pre>
  <p><code>Startup.cs</code>:</p>
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      services.AddControllers();
      services.AddSwaggerGen(c =&gt;
          {
              c.SwaggerDoc(&quot;v1&quot;, new OpenApiInfo { Title = &quot;MVATest&quot;, Version = &quot;v1&quot; });
          });
  }
  
  // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
  public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
  {
      if (env.IsDevelopment())
      {
          app.UseDeveloperExceptionPage();
          app.UseSwagger();
          app.UseSwaggerUI(c =&gt; c.SwaggerEndpoint(&quot;/swagger/v1/swagger.json&quot;, &quot;MVATest v1&quot;));
      }
  
      app.UseRouting();
  
      app.UseAuthorization();
  
      app.UseEndpoints(endpoints =&gt;
          {
              endpoints.MapControllers();
          });
  }
  </code></pre>
  <p><code>Program.cs</code>:</p>
  <pre><code>public static IHostBuilder CreateHostBuilder(string[] args) =&gt;
              Host.CreateDefaultBuilder(args)
                  .ConfigureWebHostDefaults(webBuilder =&gt;
                  {
                      webBuilder.UseStartup&lt;Startup&gt;();
                  });
  </code></pre>