# CommandResults

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

A factory for [ExecuteCommandResult](/reference/api/csharp/aspire.hosting/executecommandresult.md).

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

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

## Methods

- [Canceled](/reference/api/csharp/aspire.hosting/commandresults/methods.md#canceled) : [ExecuteCommandResult](/reference/api/csharp/aspire.hosting/executecommandresult.md) `static` -- Produces a canceled result.
- [Failure(string?)](/reference/api/csharp/aspire.hosting/commandresults/methods.md#failure-string) : [ExecuteCommandResult](/reference/api/csharp/aspire.hosting/executecommandresult.md) `static` -- Produces an unsuccessful result with an error message.
- [Failure(string, string, CommandResultFormat)](/reference/api/csharp/aspire.hosting/commandresults/methods.md#failure-string-string-commandresultformat) : [ExecuteCommandResult](/reference/api/csharp/aspire.hosting/executecommandresult.md) `static` -- Produces an unsuccessful result with an error message and result data.
- [Failure(string, CommandResultData)](/reference/api/csharp/aspire.hosting/commandresults/methods.md#failure-string-commandresultdata) : [ExecuteCommandResult](/reference/api/csharp/aspire.hosting/executecommandresult.md) `static` -- Produces an unsuccessful result with an error message and a value.
- [Failure(Exception)](/reference/api/csharp/aspire.hosting/commandresults/methods.md#failure-exception) : [ExecuteCommandResult](/reference/api/csharp/aspire.hosting/executecommandresult.md) `static` -- Produces an unsuccessful result from an `Exception`. `Exception.Message` is used as the error message.
- [Success](/reference/api/csharp/aspire.hosting/commandresults/methods.md#success) : [ExecuteCommandResult](/reference/api/csharp/aspire.hosting/executecommandresult.md) `static` -- Produces a success result.
- [Success(string, string, CommandResultFormat)](/reference/api/csharp/aspire.hosting/commandresults/methods.md#success-string-string-commandresultformat) : [ExecuteCommandResult](/reference/api/csharp/aspire.hosting/executecommandresult.md) `static` -- Produces a success result with a message and result data.
- [Success(string, CommandResultData)](/reference/api/csharp/aspire.hosting/commandresults/methods.md#success-string-commandresultdata) : [ExecuteCommandResult](/reference/api/csharp/aspire.hosting/executecommandresult.md) `static` -- Produces a success result with a message and a value.
