# MissingParameterValueException

- 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/MissingParameterValueException.cs)
- Inherits: [DistributedApplicationException](/reference/api/csharp/aspire.hosting/distributedapplicationexception.md)

The exception that is thrown when a parameter resource cannot be initialized because its value is missing or cannot be resolved.

## Definition

```csharp
namespace Aspire.Hosting;

public class MissingParameterValueException
    : Aspire.Hosting.DistributedApplicationException
{
    // ...
}
```

## Remarks

This exception is typically thrown when:

- A parameter value is not provided in configuration and has no default value
- A parameter's value callback throws an exception during execution
- A parameter's value cannot be retrieved from the configured source (e.g., user secrets, environment variables)

## Constructors

- [MissingParameterValueException(string)](/reference/api/csharp/aspire.hosting/missingparametervalueexception/constructors.md#constructor-string) -- Initializes a new instance of the [MissingParameterValueException](/reference/api/csharp/aspire.hosting/missingparametervalueexception.md) class with a specified error message.
- [MissingParameterValueException(string, Exception)](/reference/api/csharp/aspire.hosting/missingparametervalueexception/constructors.md#constructor-string-exception) -- Initializes a new instance of the [MissingParameterValueException](/reference/api/csharp/aspire.hosting/missingparametervalueexception.md) class with a specified error message and a reference to the inner exception that is the cause of this exception.
