# RequiredCommandValidationContext

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

Provides context for validating a required command.

## Definition

```go
type RequiredCommandValidationContext interface{}
```

## Properties

- `CancellationToken`: `*CancellationToken` `get` -- Gets a cancellation token that can be used to cancel the validation.
- `ResolvedPath`: `string` `get` -- Gets the resolved full path to the command executable.
- `Services`: [`ServiceProvider`](/reference/api/go/aspire.hosting/serviceprovider.md) `get` -- Gets the service provider for accessing application services.

## Methods

- [Failure](/reference/api/go/aspire.hosting/requiredcommandvalidationcontext/failure.md) -- `method` -- Creates a failed validation result with the specified message.
  ```go
  Failure(validationMessage string) RequiredCommandValidationResult
  ```
- [Success](/reference/api/go/aspire.hosting/requiredcommandvalidationcontext/success.md) -- `method` -- Creates a successful validation result.
  ```go
  Success() RequiredCommandValidationResult
  ```
