AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

IIS Application hosting of Blazor Server app not working

Open LarsOutzen opened this issue 3 years ago • 6 comments

[EDIT by guardrex to update the metadata]

Regarding "In a Blazor Server app, use either of the following approaches:" Have you tested either of the options for the Blazor Server Template project's Counter on Windows Home edition?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

LarsOutzen avatar Aug 09 '22 10:08 LarsOutzen

Hello @LarsOutzen ... That's not a supported scenario ...

https://docs.microsoft.com/aspnet/core/host-and-deploy/iis/advanced#virtual-directories

guardrex avatar Aug 09 '22 11:08 guardrex

This is not a documentation bug, it is a bug in .NET Core 6.0 ? It does not work in VS17 nor in VS17preview nor on IIS Have just tested the Blazor Server template project, with a new Non managed app pool on an IIS (virtual sub) Application. The best result is obtained when BOTH setting <base href="/CoolApp/"> and app.UsePathBase("/CoolApp"); + app.UseStaticFiles("/CoolApp"); - But the Counter does not work!

LarsOutzen avatar Aug 09 '22 12:08 LarsOutzen

It's not supported in all of ASP.NET Core. It's not supposed to work.

guardrex avatar Aug 09 '22 12:08 guardrex

Let me know when you have tested Option 1 and Option 2 on IIS for your Blazor Server template projects' counter ...

LarsOutzen avatar Aug 09 '22 12:08 LarsOutzen

Open an issue for the product unit at ....

https://github.com/dotnet/aspnetcore/issues

... but note that virtual directories are not supported. If you tell them that you're trying to host the app in a virtual directory, they're going to tell you the same thing that I just said ... not supported ... and close the issue.

Please add ...

cc: @guardrex https://github.com/dotnet/AspNetCore.Docs/issues/26667

... to the bottom of your opening comment.

guardrex avatar Aug 09 '22 12:08 guardrex

I see an organizational change that I'd like to make to the Blazor Server hosting doc based on your report. The requirements for IIS should probably be near the top and cross-linking the SignalR Service section from there might be a good idea.

If additional work comes about from the product unit issue discussion, I'll add notes for that on this issue.

guardrex avatar Aug 09 '22 13:08 guardrex