Blazor.WebAssembly.SingleSpa 0.3.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Blazor.WebAssembly.SingleSpa --version 0.3.2
                    
NuGet\Install-Package Blazor.WebAssembly.SingleSpa -Version 0.3.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Blazor.WebAssembly.SingleSpa" Version="0.3.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Blazor.WebAssembly.SingleSpa" Version="0.3.2" />
                    
Directory.Packages.props
<PackageReference Include="Blazor.WebAssembly.SingleSpa" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Blazor.WebAssembly.SingleSpa --version 0.3.2
                    
#r "nuget: Blazor.WebAssembly.SingleSpa, 0.3.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Blazor.WebAssembly.SingleSpa@0.3.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Blazor.WebAssembly.SingleSpa&version=0.3.2
                    
Install as a Cake Addin
#tool nuget:?package=Blazor.WebAssembly.SingleSpa&version=0.3.2
                    
Install as a Cake Tool

Blazor.WebAssembly.SingleSpa

Proof of concept around enabling the integration of Blazor WASM applications as micro frontends targeting single-spa

🚨 NOTE 🚨

In the near future, .NET 8 will be the only version of .NET targeted by this experimental package. The .NET 7 specific versions will be dropped. Also, this README is in need of some major updates. They will come once the work on supporting .NET 8 has settled.

Applicable Versions

The Blazor.WebAssembly.SingleSpa NuGet package contains experimental support for projects targeting .NET 7 and .NET 8. Specifically, the assets for each target framework version were built from the following specific versions of ASP.NET Core:

Target Framework Version ASP.NET Core Version
.NET 7 7.0.15
.NET 8 8.0.1

For a given target framework version, this package may work for previous minor/patch releases. However, no guarantees are given.

Usage

In general, installing this package in your Blazor WebAssembly project is sufficient for getting the modified Blazor startup script:

dotnet add package Blazor.WebAssembly.SingleSpa

However, to fully integrate a Blazor-based micro frontend, you will need to, at the very least, supply implementations for the three core single-spa lifecycle callbacks (bootstrap, mount, and unmount). How you do this is up to you and your project's needs. As part of this proof of concept, I have put together a simple web app built on single-spa that incorporates both Lit-based and Blazor-based micro frontends. See here: blazing-lit-mfe-demo

Building from source

This repository is structured around the following idea: for a given major version N of ASP.NET Core, a submodule named aspnetcore/N.x is located at src/aspnetcore/N.x, Each submodule is configured to pull a version tag from the dotnet/aspnetcore repository matching the specified major version number, e.g., src/aspnetcore/7.x pulls the commit of dotnet/aspnetcore tagged with v7.0.15.

Within this project's patches directory are a corresponding set of patches and scripts, one for each major version of ASP.NET Core that has been tested. The Build-PatchedBlazorWasm.ps1 script in each versioned directory will apply the patch located alongside it to the corresponding version of the ASP.NET Core repository and build the necessary components to produce a set of patched Blazor WebAssembly assets, such as the blazor.webassembly.js startup script.

The final Blazor assets are then copied to the appropriate location within the src/Blazor.WebAssembly.SingleSpa project so that when the final NuGet is built the assets are in the correct package location.

Installing prerequisites

Building this package requires .NET SDK 8+, Node.js 16.9+, Yarn 1, and PowerShell 7+.

.NET SDK 8+

Download from here.

Node.js

Installing Node can vary based on things like your operating system and your preferred workflow. On Windows, I prefer to use nvm-windows, and on Mac and Linux, I use nvm. Your mileage may vary. You just need to make sure it is at least Node.js 16.9 or greater (LTS versions preferred).

Yarn 1

After Node is installed, install Yarn 1 globally:

npm install -g yarn
PowerShell

All the build and patch scripts are written in PowerShell for cross-platform support. Download it from here.

Patching ASP.NET Core

To patch a version of ASP.NET Core's Blazor WASM startup script, run the patches/<version>/Build-PatchedBlazorWasm.ps1 script.

🚀 By default, the resulting script is minified. If you want to produce an unminified version for reading and/or debugging purposes, pass the -DisableMinify switch to the script.

Building Blazor.WebAssembly.SingleSpa

From the src/Blazor.WebAssembly.SingleSpa directory, run dotnet pack -c Release. This will produce the final Blazor.WebAssembly.SingleSpa NuGet package.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.10.0 126 8/10/2026
0.7.0 678 11/23/2025
0.6.1 647 9/29/2025
0.6.0 578 9/24/2025
0.5.0 1,005 11/14/2024
0.4.3 1,225 2/14/2024
0.4.2 588 2/13/2024
0.4.1 594 2/13/2024
0.4.0 609 2/13/2024
0.3.2 601 2/8/2024
0.3.1 588 2/6/2024
0.3.0 604 2/6/2024
0.2.1 602 1/17/2024
0.2.0 634 12/4/2023
0.1.3 616 10/24/2023
0.1.2 672 5/23/2023
0.1.1 637 5/23/2023
0.1.0 638 5/19/2023