# AddBlazorGateway

- Module: [Aspire.Hosting.Blazor](/reference/api/go/aspire.hosting.blazor.md)
- Version: `17.0.0-preview.1.26567.5`
- Kind: `method`
- Defined on: `DistributedApplicationBuilder`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

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.

## Remarks

Development requires a .NET SDK compatible with the configured gateway tool package.
When publishing attached Blazor WebAssembly apps, each client must target a single framework
supported by this package. The client's selected SDK must be available locally and is
installed in the build image. The AppHost and client projects must also
be contained by a common ancestor directory with a `.sln` or `.slnx` file; that
directory is used as the Docker build context.

## Definition

```go
func (DistributedApplicationBuilder) AddBlazorGateway(name string) ProjectResource
```

## Parameters

- `name` (`string`)

## Returns

`ProjectResource`

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

## Applies to

- `DistributedApplicationBuilder`
