# RequiredCommandResourceExtensions

- 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/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.
