Skip to content
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

Merged
merged 3 commits into from
Jun 4, 2018

Conversation

nguerrera
Copy link
Contributor

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

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.
@nguerrera nguerrera requested review from eerhardt and a team April 18, 2018 19:52
Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@nguerrera
Copy link
Contributor Author

Hmm, seems I was wrong about this not impacting anything because tests are failing. Investigating

@nguerrera
Copy link
Contributor Author

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
Copy link
Contributor Author

@eerhardt Can you look at 0089c00?

@livarcocc
Copy link
Contributor

@nguerrera is this good to go in?

@eerhardt
Copy link
Member

eerhardt commented Jun 4, 2018

somehow someone denied me write access to this repo, meaning my reviews no longer "count". 😝

@nguerrera nguerrera merged commit 9ef03a3 into dotnet:release/2.1.4xx Jun 4, 2018
@nguerrera nguerrera deleted the fix-1738 branch June 4, 2018 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants