From fa55e6fa2bf65a86dd3a1de4d2101b325c253147 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 25 Feb 2016 13:33:37 -0800 Subject: [PATCH] Fix DHT when referencing projects --- .../InternalModels/ProjectContextSnapshot.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/dotnet/commands/dotnet-projectmodel-server/InternalModels/ProjectContextSnapshot.cs b/src/dotnet/commands/dotnet-projectmodel-server/InternalModels/ProjectContextSnapshot.cs index 195bf5ba1..684d2e403 100644 --- a/src/dotnet/commands/dotnet-projectmodel-server/InternalModels/ProjectContextSnapshot.cs +++ b/src/dotnet/commands/dotnet-projectmodel-server/InternalModels/ProjectContextSnapshot.cs @@ -47,16 +47,21 @@ namespace Microsoft.DotNet.ProjectModel.Server foreach (var export in allExports.Values) { allSourceFiles.AddRange(export.SourceReferences.Select(f => f.ResolvedPath)); - allFileReferences.AddRange(export.CompilationAssemblies.Select(asset => asset.ResolvedPath)); - var diagnostics = diagnosticsLookup[export.Library].ToList(); var description = DependencyDescription.Create(export.Library, diagnostics, allExports); allDependencies[description.Name] = description; var projectDescription = export.Library as ProjectDescription; - if (projectDescription != null && projectDescription.Identity.Name != context.ProjectFile.Name) + if (projectDescription != null) { - allProjectReferences.Add(ProjectReferenceDescription.Create(projectDescription)); + if (projectDescription.Identity.Name != context.ProjectFile.Name) + { + allProjectReferences.Add(ProjectReferenceDescription.Create(projectDescription)); + } + } + else + { + allFileReferences.AddRange(export.CompilationAssemblies.Select(asset => asset.ResolvedPath)); } }