Skip to content

Commit d1ab911

Browse files
Ignore unversioned references
Implicit SDK references do not have version numbers and are resolved by the platform. Currently causes an Exception for AspNetCore.App projects (2.2).
1 parent e2fed88 commit d1ab911

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Depends.Core/DependencyAnalyzer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Collections.Concurrent;
44
using System.IO;
@@ -259,7 +259,9 @@ public DependencyGraph Analyze(string projectPath, string framework = null)
259259
}
260260
}
261261

262+
// Ignore unversioned references like implicit SDK packages
262263
builder.WithEdges(analyzerResult.GetItems("PackageReference")
264+
.Where(x => x.Metadata.ContainsKey("Version"))
263265
.Select(x => new Edge(projectNode, libraryNodes[x.ItemSpec], x.Metadata["Version"])));
264266

265267
var references = analyzerResult.References//GetItems("Reference")

0 commit comments

Comments
 (0)