提交 9f48fefb 编写于 作者: A Andrew Casey

Merge pull request #1202 from amcasey/DD1130538

Handle not-yet-loaded projects in GetENCBuildState
......@@ -783,8 +783,23 @@ public int GetENCBuildState(ShellInterop.ENC_BUILD_STATE[] pENCBuildState)
}
else if (_encService.EditSession != null)
{
_projectBeingEmitted = _vsProject.VisualStudioWorkspace.CurrentSolution.GetProject(_vsProject.Id);
_lastEditSessionSummary = GetProjectAnalysisSummary(_projectBeingEmitted);
// Fetch the latest snapshot of the project and get an analysis summary for any changes
// made since the break mode was entered.
var currentProject = _vsProject.VisualStudioWorkspace.CurrentSolution.GetProject(_vsProject.Id);
if (currentProject == null)
{
// If the project has yet to be loaded into the solution (which may be the case,
// since they are loaded on-demand), then it stands to reason that it has not yet
// been modified.
// TODO (https://github.com/dotnet/roslyn/issues/1204): this check should be unnecessary.
_lastEditSessionSummary = ProjectAnalysisSummary.NoChanges;
log.Write($"Project '{_vsProject.DisplayName}' has not yet been loaded into the solution");
}
else
{
_projectBeingEmitted = currentProject;
_lastEditSessionSummary = GetProjectAnalysisSummary(_projectBeingEmitted);
}
_encService.EditSession.LogBuildState(_lastEditSessionSummary);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册