Watch Aspire live streamsDocsTry Aspire

withLifetime

Method
📦 Aspire.Hosting v17.0.0
interface ContainerResource {
// ... omitted for brevity
withLifetime(lifetime: ContainerLifetime): ContainerResource;
}

Signature

methodwithLifetimebuilder
Sets the lifetime behavior of the container resource.
withLifetime(lifetime: ContainerLifetime): ContainerResource
lifetimeContainerLifetimeThe lifetime behavior of the container resource. The default behavior is `Session`.
ContainerResource

Applies to

This method applies to the following types: