Search code examples
c#iisblazorblazor-webassembly

Blazor WebAssembly Standalone: Failed to load resource: the server responded with a status of 404 (Not Found) - manifest.webmanifest


I created a Blazor WebAssembly standalone application by choosing the appropriate template in VS 2022 Community, targeting .NET 8.0. And I didn't change anything in it. I just wanted to try to host it locally on IIS, and I've done it by publishing the app to the folder first.

And then copy-pasted the content of wwwroot to the web site that I created under C:\inetpub\wwwroot\BlazorTest.

So, I think that I've done all the standard things, but I am getting an error when trying to open the web site

An unhandled error has occurred

And when I inspect the error in Google Chrome, I can see a list of errors like this:

enter image description here

I tried to Google the answer but with no success so far, additionally all this files with 404 status are actually there, so none is missing from the publish folder.

What could be the problem here?


Solution

  • It turned out that I was missing Asp Net Core Hosting Bundle:

    "The .NET Core Hosting bundle is an installer for the .NET Core Runtime and the ASP.NET Core Module. The bundle allows ASP.NET Core apps to run with IIS."

    https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/hosting-bundle?view=aspnetcore-9.0

    Once I installed that and restarted IIS suddenly everything starts to work!