-
Notifications
You must be signed in to change notification settings - Fork 789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix net sdk references discovery #10569
Conversation
let version, frameworkRefsPackDirectoryRoot = | ||
try | ||
let version = DirectoryInfo(implementationAssemblyDir).Name | ||
let microsoftNETCoreAppRef = Path.Combine(implementationAssemblyDir, "../../../packs/Microsoft.NETCore.App.Ref") | ||
if Directory.Exists(microsoftNETCoreAppRef) then | ||
Some version, Some microsoftNETCoreAppRef | ||
let directory = DirectoryInfo(microsoftNETCoreAppRef).GetDirectories() | ||
|> Array.sortBy (fun di -> di.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should really be a semver comparison, but that gets nasty so I suppose this is good enough.
Could you check this, though, with a purposely badly named runtime dir name? I commonly pretend to remove, e.g., the 3.1.2
dir by renaming it to brettfo_3.1.2
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes numbers are better than string comparisons. I will change it.
* Fix net sdk references discovery * Do numbers properly * version filter
* Fix net sdk references discovery * Do numbers properly * version filter
* Fix net sdk references discovery * Do numbers properly * version filter
The original algorithm for mapping NETSdk pack locations from the implementation directoy was incorrect.
We now compute the NETSdk reference assembly to be the highest version that is lower or equal to the implementation version.