Aspire.Hosting.Blazor
13.6.4-preview.1.26523.11
Prefix Reserved
dotnet add package Aspire.Hosting.Blazor --version 13.6.4-preview.1.26523.11
NuGet\Install-Package Aspire.Hosting.Blazor -Version 13.6.4-preview.1.26523.11
<PackageReference Include="Aspire.Hosting.Blazor" Version="13.6.4-preview.1.26523.11" />
<PackageVersion Include="Aspire.Hosting.Blazor" Version="13.6.4-preview.1.26523.11" />
<PackageReference Include="Aspire.Hosting.Blazor" />
paket add Aspire.Hosting.Blazor --version 13.6.4-preview.1.26523.11
#r "nuget: Aspire.Hosting.Blazor, 13.6.4-preview.1.26523.11"
#:package Aspire.Hosting.Blazor@13.6.4-preview.1.26523.11
#addin nuget:?package=Aspire.Hosting.Blazor&version=13.6.4-preview.1.26523.11&prerelease
#tool nuget:?package=Aspire.Hosting.Blazor&version=13.6.4-preview.1.26523.11&prerelease
Blazor hosting integration
Use this integration to model, configure, and orchestrate Blazor WebAssembly applications and a Blazor Gateway in an Aspire solution.
Getting started
Prerequisites
An existing Blazor WebAssembly project and any backend API projects it calls. The example below assumes the API exposes an endpoint named http.
Add the integration
From your AppHost directory, add the Aspire.Hosting.Blazor integration with the Aspire CLI:
aspire add Aspire.Hosting.Blazor
The Blazor gateway APIs are experimental. C# callers must opt in by suppressing ASPIREBLAZOR001, as shown below.
Usage example
Then, in the AppHost, add a Blazor WebAssembly resource, reference its backend API, and attach it to a gateway with either C# or TypeScript. For the C# example, add project references to ApiService and BlazorApp from the AppHost.
C#
#pragma warning disable ASPIREBLAZOR001
var builder = DistributedApplication.CreateBuilder(args);
var api = builder.AddProject<Projects.ApiService>("api");
var blazor = builder.AddBlazorWasmProject<Projects.BlazorApp>("web")
.WithReference(api);
builder.AddBlazorGateway("gateway")
.WithBlazorClientApp(blazor)
.WithExternalHttpEndpoints();
builder.Build().Run();
#pragma warning restore ASPIREBLAZOR001
TypeScript
import { createBuilder } from "./.aspire/modules/aspire.mjs";
const builder = await createBuilder();
const api = await builder.addProject("api", "../ApiService/ApiService.csproj");
const blazor = await builder.addBlazorWasmProject("web", "../BlazorApp/BlazorApp.csproj")
.withReference(await api.getEndpoint("http"));
await builder.addBlazorGateway("gateway")
.withBlazorClientApp(blazor)
.withExternalHttpEndpoints();
await builder.build().run();
The gateway serves the client app at /web/ and proxies requests to its referenced APIs. No separate gateway project is required.
Additional documentation
- https://aspire.dev/integrations/gallery/
- https://aspire.dev/integrations/dotnet/blazor-get-started/
- https://aspire.dev/integrations/dotnet/blazor-hosting/
- https://aspire.dev/integrations/dotnet/blazor-connect/
- https://learn.microsoft.com/aspnet/core/blazor/
Feedback & contributing
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net8.0
- Aspire.Hosting (>= 13.6.4)
- Aspire.Hosting.Dotnet (>= 13.6.4-preview.1.26523.11)
- AspNetCore.HealthChecks.Uris (>= 9.0.0)
- Google.Protobuf (>= 3.36.1)
- Grpc.AspNetCore (>= 2.83.0)
- Grpc.Net.ClientFactory (>= 2.83.0)
- Grpc.Tools (>= 2.83.0)
- Hex1b (>= 0.168.0)
- KubernetesClient (>= 19.0.2)
- MessagePack (>= 2.5.307)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.31)
- Microsoft.Extensions.FileSystemGlobbing (>= 10.0.12)
- Microsoft.Extensions.Hosting (>= 10.0.12)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Http (>= 10.0.12)
- Microsoft.Extensions.Logging (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- Microsoft.Extensions.Primitives (>= 10.0.12)
- ModelContextProtocol (>= 1.4.1)
- Newtonsoft.Json (>= 13.0.4)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.17.0)
- OpenTelemetry.Extensions.Hosting (>= 1.17.0)
- Polly.Core (>= 8.7.0)
- Semver (>= 3.0.0)
- StreamJsonRpc (>= 2.25.29)
- System.IO.Hashing (>= 10.0.12)
- System.Text.Json (>= 10.0.12)
- YamlDotNet (>= 18.1.0)
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 |
|---|---|---|
| 13.6.4-preview.1.26523.11 | 253 | 10/24/2026 |
| 13.6.3-preview.1.26521.2 | 223 | 10/21/2026 |
| 13.6.2-preview.1.26519.11 | 169 | 10/20/2026 |
| 13.6.1-preview.1.26506.6 | 1,113 | 10/7/2026 |
| 13.6.0-preview.1.26479.8 | 1,393 | 9/29/2026 |
| 13.5.4-preview.1.26464.4 | 1,652 | 9/15/2026 |
| 13.5.3-preview.1.26425.3 | 1,205 | 8/25/2026 |
| 13.5.2-preview.1.26421.6 | 265 | 8/21/2026 |
| 13.5.1-preview.1.26420.4 | 109 | 8/20/2026 |
| 13.5.0-preview.1.26417.10 | 280 | 8/18/2026 |
| 13.4.6-preview.1.26319.6 | 3,115 | 6/19/2026 |
| 13.4.5-preview.1.26316.12 | 368 | 6/17/2026 |
| 13.4.4-preview.1.26314.3 | 394 | 6/15/2026 |
| 13.4.3-preview.1.26305.13 | 136 | 6/8/2026 |
| 13.4.2-preview.1.26303.6 | 180 | 6/3/2026 |
| 13.4.1-preview.1.26303.3 | 93 | 6/3/2026 |
| 13.4.0-preview.1.26281.18 | 120 | 6/1/2026 |