提交 c157269f 编写于 作者: K Kevin Pilch-Bisson

Fix P2P ref tracking

上级 56f2fe0c
......@@ -126,7 +126,6 @@ int IVsSolutionLoadEvents.OnAfterBackgroundSolutionLoadComplete()
OutputToOutputWindow($"Creating projects - start");
var targetPathsToProjectPaths = BuildTargetPathMap(projectInfos);
//var targetPathsToProjectPaths = projectInfos.ToImmutableDictionary(kvp => kvp.Value.TargetPath, kvp => kvp.Key);
foreach (var projectFilename in projectInfos.Keys)
{
CreateProjectFromArgumentsAndReferences(
......@@ -260,6 +259,7 @@ private void OutputToOutputWindow(string message)
var existingReferenceOutputPath = referencedProject?.BinOutputPath;
if (existingReferenceOutputPath != null)
{
addedProjectReferences.Add(projectReferencePath);
projectContext.AddMetadataReference(
existingReferenceOutputPath,
new MetadataReferenceProperties());
......@@ -274,11 +274,14 @@ private void OutputToOutputWindow(string message)
foreach (var reference in commandLineArguments.MetadataReferences)
{
string possibleProjectReference;
if (!targetPathsToProjectPaths.TryGetValue(reference.Reference, out possibleProjectReference) ||
!addedProjectReferences.Contains(possibleProjectReference))
if (targetPathsToProjectPaths.TryGetValue(reference.Reference, out possibleProjectReference) &&
addedProjectReferences.Contains(possibleProjectReference))
{
projectContext.AddMetadataReference(reference.Reference, reference.Properties);
// We already added a P2P reference for this, we don't need to add the file reference too.
continue;
}
projectContext.AddMetadataReference(reference.Reference, reference.Properties);
}
foreach (var reference in commandLineArguments.AnalyzerReferences)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册