# RequiredCommandResourceExtensions

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

Provides extension methods for adding required command annotations to resources.

## Definition

```csharp
namespace Aspire.Hosting;

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

## Methods

- [WithRequiredCommand(IResourceBuilder<T>, string, string?)](/reference/api/csharp/aspire.hosting/requiredcommandresourceextensions/methods.md#withrequiredcommand-iresourcebuilder-t-string-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Declares that a resource requires a specific command/executable to be available on the local machine PATH before it can start.
- [WithRequiredCommand(IResourceBuilder<T>, string, Func<RequiredCommandValidationContext, Task<RequiredCommandValidationResult>>, string?)](/reference/api/csharp/aspire.hosting/requiredcommandresourceextensions/methods.md#withrequiredcommand-iresourcebuilder-t-string-func-requiredcommandvalidationcontext-task-requiredcommandvalidationresult-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `experimental` `ats ignored` -- Declares that a resource requires a specific command/executable to be available on the local machine PATH before it can start, with custom validation logic.
