diff --git a/Nodejs/Product/Nodejs/Commands/ImportWizardCommand.cs b/Nodejs/Product/Nodejs/Commands/ImportWizardCommand.cs index 280ec4a10..f94f82931 100644 --- a/Nodejs/Product/Nodejs/Commands/ImportWizardCommand.cs +++ b/Nodejs/Product/Nodejs/Commands/ImportWizardCommand.cs @@ -16,12 +16,14 @@ using System; using System.IO; +using System.Threading.Tasks; +using System.Threading; using System.Windows; using Microsoft.NodejsTools.Project; using Microsoft.VisualStudio; using Microsoft.VisualStudio.Shell.Interop; using Microsoft.VisualStudioTools; - + namespace Microsoft.NodejsTools.Commands { /// /// Provides the command to import a project from existing code. @@ -89,7 +91,10 @@ public override void DoCommand(object sender, EventArgs args) { } else { statusBar.SetText("An error occurred and your project was not created."); } - }, System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext()); + }, + CancellationToken.None, + TaskContinuationOptions.HideScheduler, + System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext()); } else { statusBar.SetText(""); } diff --git a/Nodejs/Product/Nodejs/Project/ImportWizard/ImportSettings.cs b/Nodejs/Product/Nodejs/Project/ImportWizard/ImportSettings.cs index ed91b8131..324367afb 100644 --- a/Nodejs/Product/Nodejs/Project/ImportWizard/ImportSettings.cs +++ b/Nodejs/Product/Nodejs/Project/ImportWizard/ImportSettings.cs @@ -207,7 +207,7 @@ public Task CreateRequestedProjectAsync() { string filters = Filters; string startupFile = StartupFile; bool excludeNodeModules = ExcludeNodeModules; - return Task.Factory.StartNew(() => { + return Task.Run(() => { bool success = false; Guid projectGuid; try {