Aspire.Hosting.Blazor
17.0.0-preview.1.26567.5
Prefix Reserved
dotnet add package Aspire.Hosting.Blazor --version 17.0.0-preview.1.26567.5
NuGet\Install-Package Aspire.Hosting.Blazor -Version 17.0.0-preview.1.26567.5
<PackageReference Include="Aspire.Hosting.Blazor" Version="17.0.0-preview.1.26567.5" />
<PackageVersion Include="Aspire.Hosting.Blazor" Version="17.0.0-preview.1.26567.5" />
<PackageReference Include="Aspire.Hosting.Blazor" />
paket add Aspire.Hosting.Blazor --version 17.0.0-preview.1.26567.5
#r "nuget: Aspire.Hosting.Blazor, 17.0.0-preview.1.26567.5"
#:package Aspire.Hosting.Blazor@17.0.0-preview.1.26567.5
#addin nuget:?package=Aspire.Hosting.Blazor&version=17.0.0-preview.1.26567.5&prerelease
#tool nuget:?package=Aspire.Hosting.Blazor&version=17.0.0-preview.1.26567.5&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.
Publishing requires the client's selected .NET SDK (8 through 11) to be available locally. The build image downloads that SDK alongside the gateway SDK, preserving client SDK selection; network access is required.
Add the integration
From your AppHost directory, add the Aspire.Hosting.Blazor integration with the Aspire CLI:
aspire add Aspire.Hosting.Blazor
aspire add Aspire.Hosting.Dotnet
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.
The C# example retains the BlazorApp project reference for AddBlazorWasmProject<Projects.BlazorApp>
metadata and client build inputs. The API service uses its real path rather than generated metadata.
See the project migration guide.
C#
#pragma warning disable ASPIREBLAZOR001
var builder = DistributedApplication.CreateBuilder(args);
var api = builder.AddDotnetProject("api", "../ApiService/ApiService.csproj");
var blazor = builder.AddBlazorWasmProject<Projects.BlazorApp>("web")
.WithReference(api);
builder.AddDotnetProjectBlazorGateway("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.addDotnetProject("api", "../ApiService/ApiService.csproj");
const blazor = await builder.addBlazorWasmProject("web", "../BlazorApp/BlazorApp.csproj")
.withReference(await api.getEndpoint("http"));
await builder.addDotnetProjectBlazorGateway("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.
AddDotnetProjectBlazorGateway returns a DotnetProjectResource builder; its matching
WithBlazorClientApp overload preserves that type. The older AddBlazorGateway keeps its
legacy return contract for compatibility. Both gateways intentionally launch the official
development tool as a process; this does not implement Project V2 service watching.
Blazor's independent ASPIREBLAZOR001 opt-in still applies.
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 | net10.0 is compatible. 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. |
-
net10.0
- Aspire.Hosting (>= 17.0.0)
- Aspire.Hosting.Dotnet (>= 17.0.0)
- 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.173.0)
- KubernetesClient (>= 19.0.2)
- MessagePack (>= 2.5.307)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.15)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.15)
- Microsoft.Extensions.FileSystemGlobbing (>= 10.0.15)
- Microsoft.Extensions.Hosting (>= 10.0.15)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Http (>= 10.0.15)
- Microsoft.Extensions.Logging (>= 10.0.15)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Options (>= 10.0.15)
- Microsoft.Extensions.Primitives (>= 10.0.15)
- ModelContextProtocol (>= 1.4.1)
- Newtonsoft.Json (>= 13.0.4)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.18.0)
- OpenTelemetry.Extensions.Hosting (>= 1.18.0)
- Polly.Core (>= 8.7.0)
- Semver (>= 3.0.0)
- StreamJsonRpc (>= 2.25.29)
- System.IO.Hashing (>= 10.0.15)
- 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 |
|---|---|---|
| 17.0.0-preview.1.26567.5 | 459 | 11/18/2026 |
| 13.6.5-preview.1.26559.7 | 1,053 | 11/10/2026 |
| 13.6.4-preview.1.26523.11 | 1,552 | 10/24/2026 |
| 13.6.3-preview.1.26521.2 | 363 | 10/21/2026 |
| 13.6.2-preview.1.26519.11 | 258 | 10/20/2026 |
| 13.6.1-preview.1.26506.6 | 1,631 | 10/7/2026 |
| 13.6.0-preview.1.26479.8 | 1,630 | 9/29/2026 |
| 13.5.4-preview.1.26464.4 | 1,715 | 9/15/2026 |
| 13.5.3-preview.1.26425.3 | 1,424 | 8/25/2026 |
| 13.5.2-preview.1.26421.6 | 317 | 8/21/2026 |
| 13.5.1-preview.1.26420.4 | 119 | 8/20/2026 |
| 13.5.0-preview.1.26417.10 | 293 | 8/18/2026 |
| 13.4.6-preview.1.26319.6 | 3,211 | 6/19/2026 |
| 13.4.5-preview.1.26316.12 | 373 | 6/17/2026 |
| 13.4.4-preview.1.26314.3 | 408 | 6/15/2026 |
| 13.4.3-preview.1.26305.13 | 146 | 6/8/2026 |
| 13.4.2-preview.1.26303.6 | 184 | 6/3/2026 |
| 13.4.1-preview.1.26303.3 | 97 | 6/3/2026 |
| 13.4.0-preview.1.26281.18 | 123 | 6/1/2026 |