Skip to content
Docs Try Aspire

ContainerLifetime

Enum net10.0
📦 Aspire.Hosting v13.1.2
Lifetime modes for container resources.
namespace Aspire.Hosting.ApplicationModel;
public sealed enum ContainerLifetime
Session = 0
Create the resource when the app host process starts and dispose of it when the app host process shuts down.
Persistent = 1
Attempt to re-use a previously created resource (based on the container name) if one exists. Do not destroy the container on app host process shutdown.