From a0bfff2006f9c05edaa66f4bc8ee4243479cc5c3 Mon Sep 17 00:00:00 2001 From: Kevin Pilch-Bisson Date: Mon, 2 Nov 2015 19:25:21 -0800 Subject: [PATCH] Disable pumping in one more place in the project system Windows erorr reporting shows reports of crashes due to LockRecursionException due to the following pattern: * ASP.NET design view forces a lazy loaded tab to be populated during solution load * That causes us to need to start pushing to workspace hosts in VisualStudioProjectTracker.StartPushingToWorkspaceAndNotifyOfOpenDocuments * Ends up waiting in Workspace.OnDocumentOpened. * Waiting pumps, and ASP.NET is finished parsing, so it tries to set the compilation options * Workspace.OnCompilationOptionsChanged throws because the lock is the same one being waited on by Workspace.OnDocumentOpened. Fixes one of the causes of internal bug 149765. --- .../ProjectSystem/VisualStudioProjectTracker.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProjectTracker.cs b/src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProjectTracker.cs index ba65d9cb02e..7ae2a4ffe0d 100644 --- a/src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProjectTracker.cs +++ b/src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProjectTracker.cs @@ -215,9 +215,12 @@ internal void AddProject(AbstractProject project) internal void StartPushingToWorkspaceAndNotifyOfOpenDocuments(IEnumerable projects) { - foreach (var hostState in _workspaceHosts) + using (Dispatcher.CurrentDispatcher.DisableProcessing()) { - hostState.StartPushingToWorkspaceAndNotifyOfOpenDocuments(projects); + foreach (var hostState in _workspaceHosts) + { + hostState.StartPushingToWorkspaceAndNotifyOfOpenDocuments(projects); + } } } -- GitLab