diff --git a/src/VisualStudio/Core/Def/Implementation/EditAndContinue/VsENCRebuildableProjectImpl.cs b/src/VisualStudio/Core/Def/Implementation/EditAndContinue/VsENCRebuildableProjectImpl.cs index 42028371d06626d4ac22bd322d608d2e610f544d..e9d5fe979b43b7c35f26073f31ae3f7afb5018b5 100644 --- a/src/VisualStudio/Core/Def/Implementation/EditAndContinue/VsENCRebuildableProjectImpl.cs +++ b/src/VisualStudio/Core/Def/Implementation/EditAndContinue/VsENCRebuildableProjectImpl.cs @@ -590,10 +590,13 @@ private void AddActiveStatements(Solution solution, ShellInterop.ENC_ACTIVE_STAT var flags = (ActiveStatementFlags)vsActiveStatement.ASINFO; - IVisualStudioHostDocument vsDocument = _vsProject.GetCurrentDocumentFromPath(vsActiveStatement.filename); - if (vsDocument != null) + // Finds a document id in the solution with the specified file path. + DocumentId documentId = solution.GetDocumentIdsWithFilePath(vsActiveStatement.filename) + .Where(dId => dId.ProjectId == _vsProject.Id).SingleOrDefault(); + + if (documentId != null) { - var document = solution.GetDocument(vsDocument.Id); + var document = solution.GetDocument(documentId); Debug.Assert(document != null); SourceText source = document.GetTextAsync(default(CancellationToken)).Result;