AspNetCore.Docs
AspNetCore.Docs copied to clipboard
IIS Application hosting of Blazor Server app not working
[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.
- ID: 9b20b470-161a-8723-b66d-c0c1804874f0
- Version Independent ID: 2712f7a2-90e7-0012-f7d9-f3a7e7e345d7
- Content: Host and deploy ASP.NET Core Blazor Server
- Content Source: aspnetcore/blazor/host-and-deploy/server.md
- Product: aspnet-core
- Technology: aspnetcore-hostdeploy
- GitHub Login: @guardrex
- Microsoft Alias: riande
Hello @LarsOutzen ... That's not a supported scenario ...
https://docs.microsoft.com/aspnet/core/host-and-deploy/iis/advanced#virtual-directories
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!
It's not supported in all of ASP.NET Core. It's not supposed to work.
Let me know when you have tested Option 1 and Option 2 on IIS for your Blazor Server template projects' counter ...
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.
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.