Watch Aspire live streamsDocsTry Aspire

AspireTerminal

Classsealednet10.0
📦 Aspire.Hosting v13.6.0
An Aspire-owned terminal handle for dashboard interaction and automation from AppHost code.
namespace Aspire.Hosting.ApplicationModel;
public sealed class AspireTerminal
: System.IAsyncDisposable
{
// ...
}
IAsyncDisposable

Obtain a handle from TerminalService.CreateTerminal or TerminalService.TryGetTerminal. Handles cannot be constructed or extended by callers; Aspire manages their registration and connection to the underlying terminal implementation.

What disposal means depends on AspireTerminal.Owner. For TerminalOwner.AppHost the AppHost owns the workload, so disposing stops it and removes the terminal from the dashboard; whoever creates such a terminal owns it and must dispose it, and showing one in an interaction does not transfer that ownership, so the terminal survives the dialog it was displayed in. For TerminalOwner.Resource the workload belongs to the resource, so disposing only releases Aspire's handle and leaves the workload running.

When an AppHost-owned workload ends, its terminal remains in the dashboard until disposed, but no longer accepts input or automation. Reopening an ended terminal displays its ended state rather than replaying output.

View all properties
View all methods