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

[Feature]: add or update package versions in the Directory.Packages.props file for CPM projects #11890

Closed
kartheekp-ms opened this issue Jun 15, 2022 · 3 comments
Assignees
Milestone

Comments

@kartheekp-ms
Copy link
Contributor

kartheekp-ms commented Jun 15, 2022

NuGet Product(s) Involved

dotnet.exe

The Elevator Pitch

Scenarios 1-4 are tracked in this request. For full list of scenarios please refer to #11915

Scenario # PackageReference exists? Directory.Packages.Props file exists? Is ManagePackageVersionsCentrally property set to true? Is VersionOverride? Current behavior New behavior in dotnet CLI In Scope
1 ✔️ ✔️ (in Directory.Packages.Props or .csproj file) Restore failed with NU1008 error and NO edits were made to the csproj file (same in VS and dotnet CLI) PackageReference should be added to .(cs/vb)proj file and PackageVersion should be added to the closest Directory.Packages.Props file ✔️
2 ✔️ in (cs/vb)proj file Restore failed with NU1008 error and NO edits were made to the csproj file (same in VS and dotnet CLI) PackageReference and Version should be added to .(cs/vb)proj file. ✔️
3 ✔️ PackageReference and Version added to .(cs/vb)proj file. In addition to the current behavior Directory.packages.props file should be deleted if it exists in the project folder
4 ✔️ ✔️ ✔️ dotnet CLI - Restore failed with NU1008 error and NO edits were made to the csproj file. VS - Clicked on Update package in PM UI. New PackageVersion added to csproj file and Directory.packages.props file was not updated No changes should be made to the Directory.Packages.Props file. Add VersionOverride attribute to the existing PackageReference item in .(cs/vb)proj file. If VersionOverride is already specified then the value should be updated. ✔️ More Info

Additional Context and Details

No response

@kartheekp-ms
Copy link
Contributor Author

Code merged into feature branch for the scenarios discussed above. https://github.com/NuGet/NuGet.Client/tree/dev-feature-cpm-dotnetaddpackage FYI @martinrrm

@kartheekp-ms
Copy link
Contributor Author

I kept this issue open because code is not yet merged to dev branch.

@martinrrm
Copy link
Contributor

@kartheekp-ms Thanks! I'll continue with this feature; I'll close this once its merged to dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants