Fix DHT when referencing projects

This commit is contained in:
Pavel Krymets 2016-02-25 13:33:37 -08:00
parent b00a75e3ea
commit fa55e6fa2b

View file

@ -47,18 +47,23 @@ namespace Microsoft.DotNet.ProjectModel.Server
foreach (var export in allExports.Values) foreach (var export in allExports.Values)
{ {
allSourceFiles.AddRange(export.SourceReferences.Select(f => f.ResolvedPath)); allSourceFiles.AddRange(export.SourceReferences.Select(f => f.ResolvedPath));
allFileReferences.AddRange(export.CompilationAssemblies.Select(asset => asset.ResolvedPath));
var diagnostics = diagnosticsLookup[export.Library].ToList(); var diagnostics = diagnosticsLookup[export.Library].ToList();
var description = DependencyDescription.Create(export.Library, diagnostics, allExports); var description = DependencyDescription.Create(export.Library, diagnostics, allExports);
allDependencies[description.Name] = description; allDependencies[description.Name] = description;
var projectDescription = export.Library as ProjectDescription; var projectDescription = export.Library as ProjectDescription;
if (projectDescription != null && projectDescription.Identity.Name != context.ProjectFile.Name) if (projectDescription != null)
{
if (projectDescription.Identity.Name != context.ProjectFile.Name)
{ {
allProjectReferences.Add(ProjectReferenceDescription.Create(projectDescription)); allProjectReferences.Add(ProjectReferenceDescription.Create(projectDescription));
} }
} }
else
{
allFileReferences.AddRange(export.CompilationAssemblies.Select(asset => asset.ResolvedPath));
}
}
snapshot.RootDependency = context.ProjectFile.Name; snapshot.RootDependency = context.ProjectFile.Name;
snapshot.TargetFramework = context.TargetFramework; snapshot.TargetFramework = context.TargetFramework;