Lewis Houlden
Lewis Houlden

Reputation: 63

Blazor WebAssembly Local IIS from Template

I am completely baffled why I cannot run the template produced by Visual Studio for Blazor WebAssembly. I've created the project from scratch with the default template (with the counter etc.). IIS Express works absolutely fine, but as soon a I change it to Local IIS, it cannot find any of the resources:

enter image description here

Why is it looking for resources at root of localhost, shouldn't it be for example http://localhost/BlazorApp1/_framework/blazor.webassembly.js

I have no doubt I am missing something obvious, but I cannot find any other SO post about it. Any help is much appreciated.

Upvotes: 0

Views: 288

Answers (1)

Lewis Houlden
Lewis Houlden

Reputation: 63

I have found that you need to add the name of your site to the base href in index.html. I'm not sure if there's a way to programatically do this but manually changing it works

From:

<base href="/" />

To:

<base href="/[SiteName]/" />

Upvotes: 2

Related Questions