Skip to content

Commit cac24a7

Browse files
committed
Merge pull request #553 from mousetraps/import
#427 Visual Studio locks up when I create project from Existing Node.js
2 parents 9c60662 + c330cb1 commit cac24a7

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

Nodejs/Product/Nodejs/Commands/ImportWizardCommand.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616

1717
using System;
1818
using System.IO;
19+
using System.Threading.Tasks;
20+
using System.Threading;
1921
using System.Windows;
2022
using Microsoft.NodejsTools.Project;
2123
using Microsoft.VisualStudio;
2224
using Microsoft.VisualStudio.Shell.Interop;
2325
using Microsoft.VisualStudioTools;
24-
26+
2527
namespace Microsoft.NodejsTools.Commands {
2628
/// <summary>
2729
/// Provides the command to import a project from existing code.
@@ -89,7 +91,10 @@ public override void DoCommand(object sender, EventArgs args) {
8991
} else {
9092
statusBar.SetText("An error occurred and your project was not created.");
9193
}
92-
}, System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext());
94+
},
95+
CancellationToken.None,
96+
TaskContinuationOptions.HideScheduler,
97+
System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext());
9398
} else {
9499
statusBar.SetText("");
95100
}

Nodejs/Product/Nodejs/Project/ImportWizard/ImportSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public Task<string> CreateRequestedProjectAsync() {
207207
string filters = Filters;
208208
string startupFile = StartupFile;
209209
bool excludeNodeModules = ExcludeNodeModules;
210-
return Task.Factory.StartNew<string>(() => {
210+
return Task.Run<string>(() => {
211211
bool success = false;
212212
Guid projectGuid;
213213
try {

0 commit comments

Comments
 (0)