DistributedApplication.Run Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Runs an application and blocks the calling thread until host shutdown is triggered and all IHostedService instances are stopped.
public void Run ();
member this.Run : unit -> unit
Public Sub Run ()
Remarks
When the .NET Aspire app host is launched via RunAsync(CancellationToken) there are two possible modes that it is running in:
Developers extending the .NET Aspire application model should consider the lifetime of IHostedService instances which are added to the dependency injection container. For more information on determining the mode that the app host is running in refer to DistributedApplicationExecutionContext.