# EnvironmentCallbackContext

- 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/EnvironmentCallbackContext.cs)

Represents a callback context for environment variables associated with a publisher.

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public class EnvironmentCallbackContext
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `Aspire.Hosting/EnvironmentCallbackContext`

## Constructors

- [EnvironmentCallbackContext(DistributedApplicationExecutionContext, Dictionary<string, object>, CancellationToken)](/reference/api/csharp/aspire.hosting/environmentcallbackcontext/constructors.md#constructor-distributedapplicationexecutioncontext-dictionary-string-object-cancellationtoken) -- Represents a callback context for environment variables associated with a publisher.
- [EnvironmentCallbackContext(DistributedApplicationExecutionContext, IResource, Dictionary<string, object>, CancellationToken)](/reference/api/csharp/aspire.hosting/environmentcallbackcontext/constructors.md#constructor-distributedapplicationexecutioncontext-iresource-dictionary-string-object-cancellationtoken) -- Initializes a new instance of the [EnvironmentCallbackContext](/reference/api/csharp/aspire.hosting/environmentcallbackcontext.md) class.

## Properties

- [CancellationToken](/reference/api/csharp/aspire.hosting/environmentcallbackcontext/properties.md#cancellationtoken) : `CancellationToken` `get` -- Gets the CancellationToken associated with the callback context.
- [EnvironmentVariables](/reference/api/csharp/aspire.hosting/environmentcallbackcontext/properties.md#environmentvariables) : `Dictionary<string, object>` `get` -- Gets the environment variables associated with the callback context.
- [ExecutionContext](/reference/api/csharp/aspire.hosting/environmentcallbackcontext/properties.md#executioncontext) : [DistributedApplicationExecutionContext](/reference/api/csharp/aspire.hosting/distributedapplicationexecutioncontext.md) `get` `ats export` -- Gets the execution context associated with this invocation of the AppHost.
- [Logger](/reference/api/csharp/aspire.hosting/environmentcallbackcontext/properties.md#logger) : `ILogger` `get; set` -- An optional logger to use for logging.
- [Resource](/reference/api/csharp/aspire.hosting/environmentcallbackcontext/properties.md#resource) : [IResource](/reference/api/csharp/aspire.hosting/iresource.md) `get` `ats export` -- The resource associated with this callback context.
