Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithBlazorClientApp

Method
📦 Aspire.Hosting.Blazor v17.0.0-preview.1.26565.2
func (ProjectResource) WithBlazorClientApp(
wasmApp BlazorWasmAppResource,
options ...*WithBlazorClientAppOptions,
) ProjectResource

Signature

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,
options ...*WithBlazorClientAppOptions,
) ProjectResource
wasmAppBlazorWasmAppResourceThe Blazor WebAssembly app to attach to the gateway.
options...*WithBlazorClientAppOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithBlazorClientAppOptions argument.

ApiPrefix*stringThe URL path prefix for API proxy routes. Defaults to "_api".
OtlpPrefix*stringThe URL path prefix for OTLP proxy routes. Defaults to "_otlp".
ProxyTelemetry*booltrue to expose the OTLP proxy for the client app; otherwise, false.
ProjectResource

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types:

typeCSharpAppResource
typeProjectResource