# DistributedApplicationException Constructors

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [DistributedApplicationException](/reference/api/csharp/aspire.hosting/distributedapplicationexception.md)
- Kind: `Constructors`
- Members: `3`

Represents an exception that is thrown when a distributed application error occurs.

## DistributedApplicationException

- Name: `Constructor`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/DistributedApplicationException.cs#L15)

Initializes a new instance of the [DistributedApplicationException](/reference/api/csharp/aspire.hosting/distributedapplicationexception.md) class. This represents an exception that is thrown when a distributed application error occurs.

```csharp
public class DistributedApplicationException
{
    public DistributedApplicationException()
    {
        // ...
    }
}
```

## DistributedApplicationException(string)

- Name: `Constructor(string)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/DistributedApplicationException.cs#L23)

Initializes a new instance of the [DistributedApplicationException](/reference/api/csharp/aspire.hosting/distributedapplicationexception.md) class, given the `message`. This represents an exception that is thrown when a distributed application error occurs.

```csharp
public class DistributedApplicationException
{
    public DistributedApplicationException(
        string message)
    {
        // ...
    }
}
```

## Parameters

- `message` (`string`)
  The error message that explains the reason for the exception.

## DistributedApplicationException(string, Exception)

- Name: `Constructor(string, Exception)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/DistributedApplicationException.cs#L32)

Initializes a new instance of the [DistributedApplicationException](/reference/api/csharp/aspire.hosting/distributedapplicationexception.md) class, given the `message` and `inner` exception. This represents an exception that is thrown when a distributed application error occurs.

```csharp
public class DistributedApplicationException
{
    public DistributedApplicationException(
        string message,
        Exception inner)
    {
        // ...
    }
}
```

## Parameters

- `message` (`string`)
  The error message that explains the reason for the exception.
- `inner` (`Exception`)
  The exception that caused the current exception.
