# AddMauiProject

- Module: [Aspire.Hosting.Maui](/reference/api/go/aspire.hosting.maui.md)
- Version: `17.0.0-preview.1.26565.2`
- Kind: `method`
- Defined on: `DistributedApplicationBuilder`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Adds a .NET MAUI project to the application model. This resource can be used to create platform-specific resources.

## Remarks

This method creates a parent MAUI project resource that serves as a container for platform-specific
resources such as Windows, Android, iOS, and macOS. The actual platform instances are added using
extension methods like `AddWindowsDevice`.
The MAUI project is not built immediately when the AppHost starts. Instead, builds are deferred
until a platform-specific resource is started, allowing faster AppHost startup and enabling
incremental builds during development.

## Definition

```go
func (DistributedApplicationBuilder) AddMauiProject(
    name string,
    projectPath string,
) MauiProjectResource
```

## Parameters

- `name` (`string`) -- The name of the resource.
- `projectPath` (`string`) -- The path to the .NET MAUI project file (.csproj). This can be a relative or absolute path.

## Returns

[`MauiProjectResource`](/reference/api/go/aspire.hosting.maui/mauiprojectresource.md) -- The resource builder.

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

## Applies to

- `DistributedApplicationBuilder`
