# ExecutableResourceBuilderExtensions

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ExecutableResourceBuilderExtensions.cs)

Provides extension methods for adding executable resources to the [IDistributedApplicationBuilder](/reference/api/csharp/aspire.hosting/idistributedapplicationbuilder.md) application model.

## Definition

```csharp
namespace Aspire.Hosting;

public static class ExecutableResourceBuilderExtensions
{
    // ...
}
```

## Methods

- [AddExecutable(IDistributedApplicationBuilder, string, string, string, string[]?)](/reference/api/csharp/aspire.hosting/executableresourcebuilderextensions/methods.md#addexecutable-idistributedapplicationbuilder-string-string-string-string) : `IResourceBuilder<ExecutableResource>` `extension` `ats export` -- Adds an executable resource to the application model.
- [AddExecutable(IDistributedApplicationBuilder, string, string, string, object[]?)](/reference/api/csharp/aspire.hosting/executableresourcebuilderextensions/methods.md#addexecutable-idistributedapplicationbuilder-string-string-string-object) : `IResourceBuilder<ExecutableResource>` `extension` `ats ignored` -- Adds an executable resource to the application model.
- [PublishAsDockerFile(IResourceBuilder<T>)](/reference/api/csharp/aspire.hosting/executableresourcebuilderextensions/methods.md#publishasdockerfile-iresourcebuilder-t) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds annotation to [ExecutableResource](/reference/api/csharp/aspire.hosting/executableresource.md) to support containerization during deployment.
- [PublishAsDockerFile(IResourceBuilder<T>, IEnumerable<DockerBuildArg>)](/reference/api/csharp/aspire.hosting/executableresourcebuilderextensions/methods.md#publishasdockerfile-iresourcebuilder-t-ienumerable-dockerbuildarg) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `obsolete` -- Adds annotation to [ExecutableResource](/reference/api/csharp/aspire.hosting/executableresource.md) to support containerization during deployment. The resulting container image is built, and when the optional `buildArgs` are provided they're used with `docker build --build-arg`.
- [PublishAsDockerFile(IResourceBuilder<T>, Action<IResourceBuilder<ContainerResource>>)](/reference/api/csharp/aspire.hosting/executableresourcebuilderextensions/methods.md#publishasdockerfile-iresourcebuilder-t-action-iresourcebuilder-containerresource) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Adds support for containerizing this [ExecutableResource](/reference/api/csharp/aspire.hosting/executableresource.md) during deployment. The resulting container image is built, and when the optional `configure` action is provided, it is used to configure the container resource.
- [WithCommand(IResourceBuilder<T>, string)](/reference/api/csharp/aspire.hosting/executableresourcebuilderextensions/methods.md#withcommand-iresourcebuilder-t-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Sets the command for the executable resource.
- [WithWorkingDirectory(IResourceBuilder<T>, string)](/reference/api/csharp/aspire.hosting/executableresourcebuilderextensions/methods.md#withworkingdirectory-iresourcebuilder-t-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Sets the working directory for the executable resource.
