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.
A program abstraction.
public interface class IHost : IDisposable
public interface IHost : IDisposable
type IHost = interface interface IDisposable
Public Interface IHost Implements IDisposable
The program's configured services.
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.(Inherited from IDisposable)
Starts the program.
Attempts to gracefully stop the program.
Runs an application and blocks the calling thread until host shutdown is triggered and all IHostedService instances are stopped.
Runs an application and returns a Task that only completes when the token is triggered or shutdown is triggered and all IHostedService instances are stopped.
Starts the host synchronously.
Attempts to gracefully stop the host with the given timeout.
Blocks the calling thread until shutdown is triggered via Ctrl+C or SIGTERM.
Returns a Task that completes when shutdown is triggered via the given token.