Skip to content

Create a Blazor WASM sample #5070

Open

Description

@lbussell

Describe the Problem

We currently have samples for standard ASP.NET Core apps. However, Blazor WASM apps are unique in that the build output is a static site, not a .dll or executable that can be run with the dotnet cli. Our existing ASP.NET Core samples won't work for Blazor WASM apps.

Describe the Solution

We should create a Blazor WASM sample app and provide example Dockerfiles for building and deploying it using a static web server using IIS, nginx, Apache, or python (or whichever other server, perhaps even a simple .NET one). Additionally, we should point to the Azure and GitHub docs for deploying static sites.

Additional Context

Activity

  1. lbussell commented on Jan 4, 2024

    @lbussell
    MemberAuthor

    [Triage] The primary concern of this repo is building and deploying apps on .NET containers. Since a Blazor WASM static site wouldn't be deployed on a .NET container image, it seems outside the scope of this repo.

    @danroth27, would it make sense to add some documentation to the existing Blazor WASM deployment documentation about deploying via containers?

    For example, here's a customer's issue and Dockerfile who is trying to deploy Blazor WASM via our ASP.NET Core image with a .dll that Blazor WASM doesn't produce.

  2. danroth27 commented on Jan 4, 2024

    @danroth27
    Member

    @lbussell Standalone Blazor WebAssembly apps are just a bunch of static files, like a JavaScript based single page app. You need to publish the app to a web server that can then serve the files. It's convenient to host the files in an ASP.NET Core app, which is what a Blazor Web App in .NET 8 is set up to do and is the recommended approach for a container-based deployment. Publishing a Blazor Web App to a container shouldn't be any different from publishing an ASP.NET Core app to a container.

  3. lbussell commented on Jan 4, 2024

    @lbussell
    MemberAuthor

    @danroth27 Ah, thank you for the clarification. I didn't realize that the blazor template had anything to do with WebAssembly so I overlooked it. I see now that it can set up a server with interactive WebAssembly as well. I'll test it out and report back here.

  4. lbussell commented on Jan 9, 2024

    @lbussell
    MemberAuthor

    From a discussion in standup today:

    Hosting static files is outside the scope of the .NET Docker project, but we should still have some sort of sample for Blazor.

    The Auto/Hybrid functionality from the blazor template seems like an appropriate middle-ground:

    Auto: Uses interactive server-side rendering while downloading the Blazor bundle and activating the Blazor runtime on the client, then uses client-side rendering with WebAssembly.

  5. added theissue type on Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions