Warm tip: This article is reproduced from serverfault.com, please click

Blazor WebAssembly publish failed

发布于 2020-12-02 14:38:27

I'm trying to publish a Blazor WebAssembly App, targeting .NET 5.0. I created a new Web Deploy publish profile from Visual Studio 2019, using the default settings:

enter image description here

The site is published to IIS, but the browser is displaying a 500.19 - Internal Server Error: "The requested page cannot be accessed because the related configuration data for the page is invalid."

enter image description here

There's a strange path for web.config, which is starting with "\\?\":

\\?\C:\inetpub\wwwroot\__ClientBlazor\web.config

I've tried any of the suggestions I've found on similar threads, but none of them solve the problem. Could it be a specific bug of VS publish wizard on Blazor projects?

Questioner
jeanie77
Viewed
0
jeanie77 2020-12-09 17:41:50

Turns out that it was an url-rewrite problem, which is addressed by this IIS Url Rewrite extension. Simply install the extension and the republish the app, it will work.

BUT other errors will then be raised, like the following: 404 on every css and javascript resources (see this and that for further details and a really weird solution).