-
Notifications
You must be signed in to change notification settings - Fork 527
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
Fixes an issue where the binding redirect version is picked from the fir... #422
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ open System.IO | |
open System.Collections.Generic | ||
open FSharp.Polyfill | ||
open System.Reflection | ||
open System.Diagnostics | ||
|
||
let private findPackagesWithContent (root,usedPackages:HashSet<_>) = | ||
usedPackages | ||
|
@@ -95,6 +96,12 @@ let createModel(root, sources,force, lockFile:LockFile) = | |
|
||
extractedPackages | ||
|
||
/// Picks the highest version of a library | ||
let private pickHighestlibraryVersion libraries = | ||
libraries | ||
|> Seq.sortBy (fun p -> FileVersionInfo.GetVersionInfo(p).FileVersion) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FileVersion is just a string while the assembly version is an object . There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Beside from the types, they could differ in content.
With this the ordering can get wrong as well. |
||
|> Seq.last | ||
|
||
/// Applies binding redirects for all strong-named references to all app. and web. config files. | ||
let private applyBindingRedirects root extractedPackages = | ||
extractedPackages | ||
|
@@ -104,7 +111,8 @@ let private applyBindingRedirects root extractedPackages = | |
match ref with | ||
| Reference.Library path -> Some path | ||
| _-> None) | ||
|> Seq.distinctBy (fun p -> FileInfo(p).Name) | ||
|> Seq.groupBy (fun p -> FileInfo(p).Name) | ||
|> Seq.map(fun (_,libraries) -> pickHighestlibraryVersion libraries) | ||
|> Seq.choose(fun assemblyFileName -> | ||
try | ||
let assembly = Assembly.ReflectionOnlyLoadFrom assemblyFileName | ||
|
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.
Can you adjust the casing of
library
toLibrary
.