AsyncPackage.InitializeAsync Method

Definition

The async initialization portion of the package initialization process. This method is invoked from a background thread.

protected:
 virtual System::Threading::Tasks::Task ^ InitializeAsync(System::Threading::CancellationToken cancellationToken, IProgress<Microsoft::VisualStudio::Shell::ServiceProgressData ^> ^ progress);
protected virtual System.Threading.Tasks.Task InitializeAsync (System.Threading.CancellationToken cancellationToken, IProgress<Microsoft.VisualStudio.Shell.ServiceProgressData> progress);
abstract member InitializeAsync : System.Threading.CancellationToken * IProgress<Microsoft.VisualStudio.Shell.ServiceProgressData> -> System.Threading.Tasks.Task
override this.InitializeAsync : System.Threading.CancellationToken * IProgress<Microsoft.VisualStudio.Shell.ServiceProgressData> -> System.Threading.Tasks.Task
Protected Overridable Function InitializeAsync (cancellationToken As CancellationToken, progress As IProgress(Of ServiceProgressData)) As Task

Parameters

cancellationToken
CancellationToken

A cancellation token to monitor for initialization cancellation, which can occur when VS is shutting down.

Returns

A task representing the async work of package initialization, or an already completed task if there is none. Do not return null from this method.

Applies to