Watch Aspire live streamsDocsTry Aspire

Aspire.Hosting.Blazor

Official
📦 Aspire.Hosting.Blazorv13.6.0-preview.1.26478.8
6Functions
1Types

Types

Functions

methodaddBlazorGatewaybuilder
Registers the built-in Blazor Gateway as a file-based C# app. The gateway is shipped as Gateway.cs alongside this library and launched via `AddCSharpApp`. No separate project is needed.
addBlazorGateway(name: string): ProjectResource
methodaddBlazorWasmProjectbuilder
Registers a Blazor WebAssembly project as a resource without launching it as a process. Prefer AddBlazorWasmProject<TProject> which uses IProjectMetadata for path discovery.
addBlazorWasmProject(name: string, projectPath: string): BlazorWasmAppResource
methodaddDotnetProjectBlazorGatewaybuilder
Adds the built-in Blazor gateway as a .NET program resource.
addDotnetProjectBlazorGateway(name: string): DotnetProjectResource
methodwithBlazorClientAppbuilder
Attaches a Blazor WebAssembly app to the Gateway. The resource name is used as the URL path prefix (e.g., resource "store" → /store/). Service names are derived from WithReference() annotations on the WASM resource. Service references from the WASM app are automatically forwarded to the gateway so the gateway can resolve service endpoints for YARP proxying.
withBlazorClientApp(wasmApp: BlazorWasmAppResource, apiPrefix?: string, otlpPrefix?: string, proxyTelemetry?: boolean): ProjectResource
methodwithBlazorClientAppbuilder
Attaches a Blazor WebAssembly app to the gateway. The app's resource name becomes its URL path prefix, and its service references are forwarded to the gateway for proxying.
withBlazorClientApp(wasmApp: BlazorWasmAppResource, apiPrefix?: string, otlpPrefix?: string, proxyTelemetry?: boolean): DotnetProjectResource
methodwithBlazorDebuggerBrowserbuilder
Configures the browser launched when starting a debug session for the Blazor WebAssembly app. The value is read when the debugger is registered on the gateway, so call this before `WithBlazorClientApp` or `WithBlazorClientApp` attaches the app.
withBlazorDebuggerBrowser(browser?: string): BlazorWasmAppResource