title: ASP.NET Core 5.0 Web App - published out of the box app to IIS Server 404 on static files from wwwroot
body: <p>Created an out-of-the-box ASP.NET Core 5.0 Web App - runs locally just fine.</p>
  <p>Published the project to a folder and copied contents to Windows Server 2019 running IIS.</p>
  <p><strong>Installed</strong> ASP.NET Core 5.0 Runtime (v5.0.5) - Windows Hosting Bundle.</p>
  <p><strong>Application Pool</strong>:  .NET CLR version: to No Managed Code Manage, pipeline mode: to Integrated</p>
  <p>Project File contains:</p>
  <pre><code>public static IHostBuilder CreateHostBuilder(string[] args) =&gt;
              Host.CreateDefaultBuilder(args)
                  .ConfigureWebHostDefaults(webBuilder =&gt;
                  {
                      webBuilder.UseStartup&lt;Startup&gt;();
                      webBuilder.UseStaticWebAssets();
                  });
  </code></pre>
  <p>Startup contains:</p>
  <pre><code>            app.UseStaticFiles();
  </code></pre>
  <p>When referenced, all content under the wwwroot folder throws a 404 error:</p>
  <pre><code>https://servername.test.com/subapplication/css/site.css
  </code></pre>
  <p>The default page does get loaded, just with no styling because of the files not found.</p>
  <p><a href="https://i.stack.imgur.com/PIbTw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PIbTw.png" alt="default" /></a></p>