public static async Task InitializeAsync(AsyncPackage package) { // Switch to the main thread - the call to AddCommand in AttachToDockerContainerDialogCommand's constructor requires // the UI thread. await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken); var dte = await package.GetServiceAsync(typeof(DTE)) as DTE; Instance = new DebugAdapterHostLauncher(dte); }
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { // When initialized asynchronously, the current thread may be a background thread at this point. // Do any initialization that requires the UI thread after switching to the UI thread. await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); await AttachToDockerContainerDialogCommand.InitializeAsync(this); await DebugAdapterHostLauncher.InitializeAsync(this); }