# Aspire.Hosting.Blazor

- Module: `Aspire.Hosting.Blazor`
- Version: `17.0.0-preview.1.26565.2`
- Import path: `apphost/modules/aspire`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)
- Functions: `6`
- Types: `2`

## Handles

- [BlazorWasmAppResource](/reference/api/go/aspire.hosting.blazor/blazorwasmappresource.md) -- `handle` - 1 members -- A resource representing a Blazor WebAssembly application project. This is not a running process -- it's metadata about a WASM project whose static web assets are served through a Gateway. Implements IResourceWithEnvironment so that WithReference() can be used to declare service dependencies (the annotations are read at orchestration time). Implements IResourceWithParent so that the orchestrator mirrors the gateway's lifecycle state (Running, Stopped, etc.) to this child resource automatically.
- [DotnetProjectResource](/reference/api/go/aspire.hosting.blazor/dotnetprojectresource.md) -- `handle` - 1 members

## Functions

- [WithBlazorDebuggerBrowser](/reference/api/go/aspire.hosting.blazor/withblazordebuggerbrowser.md) -- `method` - on `BlazorWasmAppResource` -- 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.
- [AddBlazorGateway](/reference/api/go/aspire.hosting.blazor/addblazorgateway.md) -- `method` - on `DistributedApplicationBuilder` -- Registers the built-in Blazor Gateway. During development the gateway runs from the official .NET tool. Publishing continues to use the file-based app shipped with this package.
- [AddBlazorWasmProject](/reference/api/go/aspire.hosting.blazor/addblazorwasmproject.md) -- `method` - on `DistributedApplicationBuilder` -- Registers a Blazor WebAssembly project as a resource without launching it as a process. Prefer AddBlazorWasmProject<TProject> which uses IProjectMetadata for path discovery.
- [AddDotnetProjectBlazorGateway](/reference/api/go/aspire.hosting.blazor/adddotnetprojectblazorgateway.md) -- `method` - on `DistributedApplicationBuilder` -- Adds the built-in Blazor gateway as a .NET program resource.
- [WithBlazorClientApp](/reference/api/go/aspire.hosting.blazor/withblazorclientapp-dotnetprojectresource-blazorwasmappresource.md) -- `method` - on `DotnetProjectResource` -- 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](/reference/api/go/aspire.hosting.blazor/withblazorclientapp-projectresource-blazorwasmappresource.md) -- `method` - on `ProjectResource` -- 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.
