# AddExecutable

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

Adds an executable resource to the application model.

## Remarks

You can run any executable command using its full path.
As a security feature, Aspire doesn't run executable unless the command is located in a path listed in the PATH environment variable.
To run an executable file that's in the current directory, specify the full path or use the relative path `./` to represent the current directory.

## Definition

```go
func (DistributedApplicationBuilder) AddExecutable(
    name string,
    command string,
    workingDirectory string,
    args []string,
) ExecutableResource
```

## Parameters

- `name` (`string`) -- The name of the resource.
- `command` (`string`) -- The executable path. This can be a fully qualified path or a executable to run from the shell/command line.
- `workingDirectory` (`string`) -- The working directory of the executable.
- `args` (`[]string`) -- The arguments to the executable.

## Returns

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

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

## Applies to

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