0

I'm trying to publish a .NET 6 Blazor WebAssembly WASM locally to IIS

I'm using Visual Studio 2022 on Windows 10

I have the .NET 6 hosting bundle installed

I'm using the default Blazor Web Assembly template installed with Visual Studio with no modifications

When I navigate to localhost I get the HTTP 509.1 Error, which indicates a malformed web.config

(Image) HTTP Error 509.1

Here is my web.config:

(Image) web.config

If I comment out the rewrite section as follows:

(Image) web.config with offending lines commented out

IIS no longer throws an exception, however it sends me to the default IIS page

Any ideas how to fix this?

Michael
  • 101
  • 2
  • 5
  • 1
    Install IIS Rewrite module and restore the rewrite section in web.config. – Lex Li Apr 23 '22 at 21:07
  • 1
    Does this answer your question? [HTTP Error 500.19 with 0x8007000d on IIS7 "Malformed XML" in web.config](https://stackoverflow.com/questions/14132029/http-error-500-19-with-0x8007000d-on-iis7-malformed-xml-in-web-config) – Lex Li Apr 23 '22 at 21:08
  • @LexLi Thank you, yes I imagine that would solve it. I'll give it a try and post back here with an answer – Michael Apr 24 '22 at 06:25
  • Does the rewrite rule exist if you create an empty blazor application? If IIS doesn't install url rewrite module, IIS cannot understand what does section mean in web.config. So you need to install it as Lex Li said. – Bruce Zhang Apr 25 '22 at 06:50

1 Answers1

0

Ensure that the .NET Core Runtime and Hosting Bundle are installed on the server. You can download them from the Microsoft website. Make sure you install the correct version corresponding to the target framework of your ASP.NET Core application.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Albert Einstein Jun 24 '23 at 11:55