# AddWindowsDevice

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

Adds a Windows device resource to run the MAUI application on the Windows platform with a specific name.

## Remarks

This method creates a new Windows platform resource that will run the MAUI application
targeting the Windows platform using `dotnet run`. The resource does not auto-start
and must be explicitly started from the dashboard by clicking the start button.
You can add multiple Windows device resources to a MAUI project by calling this method multiple times with different names.

## Definition

```go
func (MauiProjectResource) AddWindowsDevice(name string) MauiWindowsPlatformResource
```

## Parameters

- `name` (`string`) -- The name of the Windows device resource.

## Returns

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

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

## Applies to

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