Skip to content
DocsTry Aspire
DocsTry

Lifetime

Enumnet10.0
📦 Aspire.Hosting v13.5.3
Lifetime modes for resources that can outlive the AppHost process.
namespace Aspire.Hosting.ApplicationModel;
public enum Lifetime
Session= 0
Create the resource when the AppHost process starts and dispose of it when the AppHost process shuts down.
Persistent= 1
Attempt to re-use a previously created resource if one exists. Do not destroy the resource on AppHost process shutdown.