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 ability for individual projects to enable or disable Central Package Management #5866

Merged
merged 2 commits into from
Jun 24, 2024

Conversation

jeffkl
Copy link
Contributor

@jeffkl jeffkl commented Jun 20, 2024

Bug

Fixes: NuGet/Home#13560

Regression? Last working version:

Description

Pull request #5572 enabled or disabled Central Package Management (CPM) if a file named Directory.Packages.props exists. It also changed when Directory.Packages.props was imported. Before, Directory.Packages.props was always imported, whether CPM was enabled or not. in #5572 this changed to only import Directory.Packages.props was imported. This breaks users who:

  1. Disable CPM in Directory.Build.props
  2. Enable CPM in a particular project

This is because Directory.Packages.props isn't imported anymore and its impossible for a project to enable it.

This change brings back the old behavior of always importing Directory.Packages.props even if CPM is disabled. The ManagePackageVersionsCentrally property still controls whether or not CPM itself is enabled, allowing users to enable CPM for any particular project. In the case where a users wants to disable the import of Directory.Packages.props, they can still set the MSBuild property ImportDirectoryPackagesProps to false.

PR Checklist

  • PR has a meaningful title

  • PR has a linked issue.

  • Described changes

  • Tests

    • Automated tests added
    • OR
    • Test exception
    • OR
    • N/A
  • Documentation

    • Documentation PR or issue filled
    • OR
    • N/A

@jeffkl jeffkl changed the title Fix CPM per-project enable/disable Fix ability for individual projects to enable or disable Central Package Management Jun 21, 2024
@jeffkl jeffkl merged commit 4153cf1 into dev Jun 24, 2024
28 checks passed
@jeffkl jeffkl deleted the dev-jeffkl-fix-cpm-perproject branch June 24, 2024 16:33
jeffkl added a commit that referenced this pull request Jun 26, 2024
jeffkl added a commit that referenced this pull request Jun 27, 2024
kartheekp-ms added a commit that referenced this pull request Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:1 PRs that are high priority and should be reviewed quickly
Projects
None yet
3 participants