# ManifestPublishingCallbackAnnotation Constructors

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [ManifestPublishingCallbackAnnotation](/reference/api/csharp/aspire.hosting/manifestpublishingcallbackannotation.md)
- Kind: `Constructors`
- Members: `2`

Represents an annotation that provides a callback to be executed during manifest publishing.

## ManifestPublishingCallbackAnnotation(Action<ManifestPublishingContext>)

- Name: `Constructor(Action<ManifestPublishingContext>)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ManifestPublishingCallbackAnnotation.cs)

Initializes a new instance of the [ManifestPublishingCallbackAnnotation](/reference/api/csharp/aspire.hosting/manifestpublishingcallbackannotation.md) class with the specified callback.

```csharp
public class ManifestPublishingCallbackAnnotation
{
    public ManifestPublishingCallbackAnnotation(
        Action<ManifestPublishingContext>? callback)
    {
        // ...
    }
}
```

## Parameters

- `callback` (`Action<ManifestPublishingContext>`)
  A callback which provides access to [ManifestPublishingContext](/reference/api/csharp/aspire.hosting/manifestpublishingcontext.md) which can be used for controlling JSON output into the manifest.

## ManifestPublishingCallbackAnnotation(Func<ManifestPublishingContext, Task>)

- Name: `Constructor(Func<ManifestPublishingContext, Task>)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ManifestPublishingCallbackAnnotation.cs)

Initializes a new instance of the [ManifestPublishingCallbackAnnotation](/reference/api/csharp/aspire.hosting/manifestpublishingcallbackannotation.md) class with the specified callback.

```csharp
public class ManifestPublishingCallbackAnnotation
{
    public ManifestPublishingCallbackAnnotation(
        Func<ManifestPublishingContext, Task>? callback)
    {
        // ...
    }
}
```

## Parameters

- `callback` (`Func<ManifestPublishingContext, Task>`)
  A callback which provides access to [ManifestPublishingContext](/reference/api/csharp/aspire.hosting/manifestpublishingcontext.md) which can be used for controlling JSON output into the manifest.
