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

Fix building projects restored with NuGet 5.7 #14517

Merged
merged 2 commits into from
Nov 20, 2020

Conversation

dsplaisted
Copy link
Member

@dsplaisted dsplaisted commented Nov 12, 2020

Description

Fix builds when assets file was created by an earlier version of NuGet.

Bugs:

Customer Impact

This will fix issues where CI builds fail because they download an older version of NuGet.exe and use this for restore.

How found

Azure pipelines canary testing

Test coverage

Automated test coverage is added with this PR

Regression?

Yes.

We had previously decided that we did not need to support building with assets files created by an earlier version of NuGet. We did not realize the impact this would have on CI builds, where it is a common pattern to download NuGet.exe and use it for the restore, and the version of NuGet.exe used may not match the version of NuGet used by the build.

Because of this impact, we have reconsidered this breaking change.

Risk

Low risk that this would break new scenarios.

Medium-low risk that there are some scenarios we haven't found that would still be broken when restoring with a previous NuGet version.

Copy link
Contributor

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

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

I think this looks good to me.

The assets file has a version, we can try using that version to detect inconsistencies.

I'll write up a proposal.

{
LockFileTarget lockFileTarget = lockFile.GetTarget(frameworkAlias, runtime);
LockFileTarget lockFileTarget = lockFile.GetTarget(frameworkAlias, runtimeIdentifier);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this looks good.

}

[WindowsOnlyFact]
public void ItCanBuildProjectRestoredWithNuGet5_7()
Copy link
Contributor

Choose a reason for hiding this comment

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

👏

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