Patrick87
Patrick87

Reputation: 249

How to deploy blazor wasm to iis as an application and not as a website

I've been trying to deploy my blazor wasm that I've published in visual studio to IIS as an application. It works when I change the base href="/app/" but upon navigating to other pages e.g. mywebsite.com/app/counter. When I press F5(refresh) in chrome it displays an iis message that says directory not found. Please help.

Upvotes: 0

Views: 2132

Answers (1)

Ajinkya Gadgil
Ajinkya Gadgil

Reputation: 147

Please install URL rewrite module on the server from https://www.iis.net/downloads/microsoft/url-rewrite. I've had same problem and installing rewrite fixed this issue. Let me know if this does not work for further research.'

Also, if you have given redirection as

Navigationmanager.NavigateTo("/counter")

Remove '/' and just use counter after you have used /app/ in index.html. It even works if you add an application as a website.

Upvotes: 1

Related Questions