Skip to content
DocsTry Aspire
DocsTry

ManifestPublishingContext Methods

ClassMethods7 members
Contextual information used for manifest publishing during this execution of the AppHost.
GetManifestRelativePath(string?)Section titled GetManifestRelativePath(string?)nullablestring?
Generates a relative path based on the location of the manifest path.
public sealed class ManifestPublishingContext
{
public string? GetManifestRelativePath(
string? path)
{
// ...
}
}
pathstring?A path to a file.
string?The specified path as a relative path to the manifest.
DistributedApplicationExceptionThrows 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)
{
// ...
}
}
valueobject?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)
{
// ...
}
}
resourceIResourceThe 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)
{
// ...
}
}
resourceIResourceThe IResource that contains CommandLineArgsCallbackAnnotation annotations.
TaskThe 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)
{
// ...
}
}
resourceIResourceThe 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)
{
// ...
}
}
containerContainerResourceThe container resource to written to the manifest.
DistributedApplicationExceptionThrown 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)
{
// ...
}
}
resourceIResourceThe IResource which contains EnvironmentCallbackAnnotation annotations.