# BlazorWasmAppResource

- Kind: `class`
- Package: [Aspire.Hosting.Blazor](/reference/api/csharp/aspire.hosting.blazor.md)
- Version: `13.4.0-preview.1.26281.18`
- Namespace: `Aspire.Hosting`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Blazor/Resources/BlazorWasmAppResource.cs)
- Inherits: `Resource`
- Implements: `IResource`, `IResourceWithEnvironment`, `IResourceWithParent`

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.

## Definition

```csharp
namespace Aspire.Hosting;

public sealed class BlazorWasmAppResource
    : Aspire.Hosting.ApplicationModel.Resource,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithEnvironment,
      Aspire.Hosting.ApplicationModel.IResourceWithParent
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `Aspire.Hosting.Blazor/BlazorWasmAppResource`

## Constructors

- [BlazorWasmAppResource(string, string)](/reference/api/csharp/aspire.hosting.blazor/blazorwasmappresource/constructors.md#constructor-string-string) -- 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.

## Properties

- [Parent](/reference/api/csharp/aspire.hosting.blazor/blazorwasmappresource/properties.md#parent) : `IResource` `get` -- Gets the parent gateway resource whose lifecycle state is mirrored to this resource. Set internally when [BlazorGatewayExtensions.WithBlazorClientApp(IResourceBuilder<ProjectResource>, IResourceBuilder<BlazorWasmAppResource>, string, string, bool)](/reference/api/csharp/aspire.hosting.blazor/blazorgatewayextensions/methods.md#withblazorclientapp-iresourcebuilder-projectresource-iresourcebuilder-blazorwasmappresource-string-string-bool) associates this WASM app with a gateway.
- [ProjectDirectory](/reference/api/csharp/aspire.hosting.blazor/blazorwasmappresource/properties.md#projectdirectory) : `string` `get` -- Directory containing the .csproj file.
- [ProjectPath](/reference/api/csharp/aspire.hosting.blazor/blazorwasmappresource/properties.md#projectpath) : `string` `get` -- Fully-qualified path to the .csproj file.
