# DistributedApplicationBuilder.AddDotnetTool

- Module: [Aspire.Hosting](/reference/api/go/aspire.hosting.md)
- Defined on: [DistributedApplicationBuilder](/reference/api/go/aspire.hosting/distributedapplicationbuilder.md)
- Version: `17.0.0`
- Kind: `method`

Adds a .NET tool resource to the application model.

## Definition

```go
type DistributedApplicationBuilder interface {
    // ... omitted for brevity
    AddDotnetTool(
        name string,
        packageId string,
    ) DotnetToolResource
}
```

## Signature

```go
AddDotnetTool(
    name string,
    packageId string,
) DotnetToolResource
```

## Parameters

- `name` (`string`) -- The name of the resource.
- `packageId` (`string`) -- The package id of the tool.

## Returns

[`DotnetToolResource`](/reference/api/go/aspire.hosting/dotnettoolresource.md) -- The resource builder.

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

## Defined on

- [DistributedApplicationBuilder](/reference/api/go/aspire.hosting/distributedapplicationbuilder.md) -- `interface`
