Skip to content
Docs Try Aspire

ManifestPublishingContext Methods

Class Methods 7 members
Contextual information used for manifest publishing during this execution of the AppHost.
GetManifestRelativePath(string?) Section titled GetManifestRelativePath(string?) nullable string?
Generates a relative path based on the location of the manifest path.
public sealed class ManifestPublishingContext
{
public string? GetManifestRelativePath(
string? path)
{
// ...
}
}
path string? A path to a file.
string? The specified path as a relative path to the manifest.
DistributedApplicationException Throws when could not get the directory directory name from the output path.
TryAddDependentResources(object?) Section titled TryAddDependentResources(object?)
Ensures that any IResource instances referenced by value are written to the manifest.
public sealed class ManifestPublishingContext
{
public void TryAddDependentResources(
object? value)
{
// ...
}
}
value object? The object to check for references that may be resources that need to be written.
Writes endpoints to the resource entry in the manifest based on the resource's EndpointAnnotation entries in the IResource.Annotations collection.
public sealed class ManifestPublishingContext
{
public void WriteBindings(
IResource resource)
{
// ...
}
}
resource IResource The IResource that contains EndpointAnnotation annotations.
WriteCommandLineArgumentsAsync(IResource) Section titled WriteCommandLineArgumentsAsync(IResource) Task
Writes command line arguments to the manifest based on the IResource resource's CommandLineArgsCallbackAnnotation annotations.
public sealed class ManifestPublishingContext
{
public Task WriteCommandLineArgumentsAsync(
IResource resource)
{
// ...
}
}
resource IResource The IResource that contains CommandLineArgsCallbackAnnotation annotations.
Task The Tasks.Task to await for completion.
WriteConnectionString(IResource) Section titled WriteConnectionString(IResource)
Writes the "connectionString" field for the underlying resource.
public sealed class ManifestPublishingContext
{
public void WriteConnectionString(
IResource resource)
{
// ...
}
}
resource IResource The IResource.
WriteContainerAsync(ContainerResource) Section titled WriteContainerAsync(ContainerResource) Task
Writes JSON elements to the manifest which represent a container resource.
public sealed class ManifestPublishingContext
{
public Task WriteContainerAsync(
ContainerResource container)
{
// ...
}
}
container ContainerResource The container resource to written to the manifest.
DistributedApplicationException Thrown if the container resource does not contain a ContainerImageAnnotation.
WriteEnvironmentVariablesAsync(IResource) Section titled WriteEnvironmentVariablesAsync(IResource) Task
Writes environment variables to the manifest base on the IResource resource's EnvironmentCallbackAnnotation annotations."/>
public sealed class ManifestPublishingContext
{
public Task WriteEnvironmentVariablesAsync(
IResource resource)
{
// ...
}
}
resource IResource The IResource which contains EnvironmentCallbackAnnotation annotations.