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:
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?
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:
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?
Share Improve this question edited yesterday Zhi Lv 21.5k1 gold badge27 silver badges37 bronze badges asked Feb 16 at 18:56 vldmrrdjccvldmrrdjcc 2,1325 gold badges23 silver badges44 bronze badges 2- are you creating new site in iis or application under default website? – Jalpa Panchal Commented Feb 17 at 10:21
- @JalpaPanchal I created new site by right clicking Sites in IIS -> add new site, so not default web site. – vldmrrdjcc Commented Feb 17 at 13:11
1 Answer
Reset to default 1It 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/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!