From 947e008fd3ad6584a39f82cf814333a91cf6e773 Mon Sep 17 00:00:00 2001 From: Heejae Chang Date: Fri, 17 Jun 2016 13:59:55 -0700 Subject: [PATCH] prevent VS from crashing if VS got shutdown while build error reporting is in progress. --- .../SolutionCrawler/SolutionCrawlerRegistrationService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Features/Core/Portable/SolutionCrawler/SolutionCrawlerRegistrationService.cs b/src/Features/Core/Portable/SolutionCrawler/SolutionCrawlerRegistrationService.cs index 3e668c0a7d1a5..d3d89522bc543 100644 --- a/src/Features/Core/Portable/SolutionCrawler/SolutionCrawlerRegistrationService.cs +++ b/src/Features/Core/Portable/SolutionCrawler/SolutionCrawlerRegistrationService.cs @@ -91,7 +91,10 @@ public void Reanalyze(Workspace workspace, IIncrementalAnalyzer analyzer, IEnume var coordinator = default(WorkCoordinator); if (!_documentWorkCoordinatorMap.TryGetValue(workspace, out coordinator)) { - throw new ArgumentException("workspace"); + // this can happen if solution crawler is already unregistered from workspace. + // one of those example will be VS shutting down so roslyn package is disposed but there is a pending + // async operation. + return; } // no specific projects or documents provided