# ExecuteCommandResult

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

The result of executing a command. Returned from [ResourceCommandAnnotation.ExecuteCommand](/reference/api/csharp/aspire.hosting/resourcecommandannotation/properties.md#executecommand).

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public sealed class ExecuteCommandResult
{
    // ...
}
```

## ATS metadata

### ATS DTO

- Serialized as a plain JSON object without a `$type` discriminator.

## Constructors

- [ExecuteCommandResult](/reference/api/csharp/aspire.hosting/executecommandresult/constructors.md#constructor)

## Properties

- [Canceled](/reference/api/csharp/aspire.hosting/executecommandresult/properties.md#canceled) : `bool` `get; init` -- A flag that indicates whether the command was canceled by the user.
- [Data](/reference/api/csharp/aspire.hosting/executecommandresult/properties.md#data) : [CommandResultData?](/reference/api/csharp/aspire.hosting/commandresultdata.md) `get; init` -- An optional value produced by the command.
- [ErrorMessage](/reference/api/csharp/aspire.hosting/executecommandresult/properties.md#errormessage) : `string?` `get; init` `obsolete` -- An optional error message that can be set when the command is unsuccessful.
- [Message](/reference/api/csharp/aspire.hosting/executecommandresult/properties.md#message) : `string?` `get; init` -- An optional message associated with the command result.
- [Success](/reference/api/csharp/aspire.hosting/executecommandresult/properties.md#success) : `bool` `get; init` -- A flag that indicates whether the command was successful.
