# Aspire.Hosting.Blazor

- Module: `Aspire.Hosting.Blazor`
- Version: `13.4.0-preview.1.26281.18`
- Source: [GitHub](https://github.com/microsoft/aspire)
- Functions: `3`
- Types: `1`

## Types

- [BlazorWasmAppResource](/reference/api/typescript/aspire.hosting.blazor/blazorwasmappresource.md) -- `handle` - 0 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.

## Functions

- [addBlazorGateway](/reference/api/typescript/aspire.hosting.blazor/addblazorgateway.md) -- `method` -- 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.
- [addBlazorWasmProject](/reference/api/typescript/aspire.hosting.blazor/addblazorwasmproject.md) -- `method` -- Registers a Blazor WebAssembly project as a resource without launching it as a process. Prefer AddBlazorWasmProject<TProject> which uses IProjectMetadata for path discovery.
- [withBlazorClientApp](/reference/api/typescript/aspire.hosting.blazor/withblazorclientapp.md) -- `method` -- 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.
