-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Never mark files from nuget as in-box fx ref assemblies #2154
Conversation
Before conflict resolution between nuget and redist list, we would end up in situations where MSBuild marked an assembly from nuget matching redist list with <= version with FrameworkFile=true metadata. This caused us to designate the assembly as type "referenceassembly" in deps.json for PreserveCompilationContext. However, that is not correct as that designation means that the assembly is literally from the targeting pack in Program Files and not from nuget. This no longer happens because the nuget assembly with smaller assembly version will be discarded during conflict resolution, favoring the in-box assembly that is correctly designated as "referenceassembly". Furthermore, an OOB with greater version than in-box will not get FrameworkFile=true set by MSBuild. As such, there's no longer a known real scenario (and hence no test here) where we will observe FrameworkFile=true on an assembly from nuget. This is therefore an defensive change in case it ever happens in the wild for unforeseeable reasons.
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.
thanks!
Hmm, seems I was wrong about this not impacting anything because tests are failing. Investigating |
So it turns out that NuGetSourceType == Package and NuGetIsFrameworkReference == true when a package nuspec indicates that a framework reference is to be added. So the fix is wrong for that case, and thankfully we had a test that hit it. This makes me concerned that all NuGetSourceType != '' are vulnerable to this. :( |
@nguerrera is this good to go in? |
somehow someone denied me write access to this repo, meaning my reviews no longer "count". 😝 |
Before conflict resolution between nuget and redist list, we would end up in
situations where MSBuild marked an assembly from nuget matching redist list with
<= version with FrameworkFile=true metadata. This caused us to designate the
assembly as type "referenceassembly" in deps.json for
PreserveCompilationContext. However, that is not correct as that designation
means that the assembly is literally from the targeting pack in Program Files
and not from nuget.
This no longer happens because the nuget assembly with smaller assembly version
will be discarded during conflict resolution, favoring the in-box assembly that
is correctly designated as "referenceassembly". Furthermore, an OOB with greater
version than in-box will not get FrameworkFile=true set by MSBuild. As such,
there's no longer a known real scenario (and hence no test here) where we will
observe FrameworkFile=true on an assembly from nuget. This is therefore an
defensive change in case it ever happens in the wild for unforeseeable reasons.
Fix #1738