Skip to content

Consider restoring the Blazor WebAssembly "hosted" option #49798

@SteveSandersonMS

Description

@SteveSandersonMS

We recently removed the --hosted option from the Blazor WebAssembly project template, on the grounds that we considered it unnecessary now that the new blazor template includes support for WebAssembly components on an ASP.NET Core host.

However, there are still clear use cases for dotnet new blazorwasm --hosted:

  1. If you want a WebAssembly-everywhere project, like we offered in .NET 7 and earlier, it would be really hard to set that up without a template for it. You'd need to do dotnet new blazor --use-wasm, then make lots of changes to move files into the WebAssembly project.
    • Further, if auth is enabled, how would people even know if they've done it right?
  2. If you want an ASP.NET-hosted PWA, this is likely going to be the only way it could work. I think we will not offer a --pwa option on the Blazor Web project, because it couldn't work offline by default (we can't cache all the SSR pages, we don't even have a way to discover them all). If our PWA is to continue meaning "offline-enabled PWA", then that will only be able to work in a WebAssembly-everywhere case, and so we need to use the blazorwasm template for that. If someone wants to combine this with being ASP.NET Core-hosted, they will need blazorwasm --hosted to be brought back.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsThis issue tracks updating documentationarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing one

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions