You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
[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.
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.
@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.
@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.
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.
Activity
lbussell commentedon Jan 4, 2024
[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.
danroth27 commentedon Jan 4, 2024
@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.
lbussell commentedon Jan 4, 2024
@danroth27 Ah, thank you for the clarification. I didn't realize that the
blazortemplate 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.lbussell commentedon Jan 9, 2024
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
blazortemplate seems like an appropriate middle-ground: