-
Notifications
You must be signed in to change notification settings - Fork 261
[Feature]: Option to migrate package references from a project to Directory.Packages.props #11753
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
Comments
If anyone's interested, I knocked up a quick tool which converts a solution (or project) to use centralised package management, here: https://github.com/Webreaper/CentralisedPackageConverter Might be useful to add it as a dotnet global tool.... |
Fyi @martinrrm By the way @nkolev92 recently created a poll to rename PackageSourceMapper tool to something like |
so, any progress on this? A proper migration tool would be very helpful. We have over 200 projects in our repo. Manually migrating is not really an option. We also have some projects that use a different version of some packages on purpose, so a smart conversion tool is necessary for us. Until we have some migration path we cannot use this. The option to migrate slowly with partly centralized package management would also work really well for us, but it is apparently unsupported and unwanted for some reason. |
@PaulVrugt Have you taken a look at this? https://github.com/Webreaper/CentralisedPackageConverter You can install the tool by running:
Then just run the tool:
|
Well yes, but it doesn't seem to take version conflicts into account properly if I read the code correctly. We have some projects using different package versions on purpose, and we want to make sure after the conversion no package versions have changes for any project |
@PaulVrugt feel free to submit a PR! 👍 |
.NET Upgrade Assistant Now Supports Upgrading to Centralized Package Mangement: https://devblogs.microsoft.com/dotnet/dotnet-upgrade-assistant-cpm-upgrade/ |
NuGet Product(s) Involved
Visual Studio Package Management UI, Visual Studio Package Manager Console
The Elevator Pitch
The new Directory.Packages.props feature is a great way of having a central place to specify package versions to use throughout a solution. For existing solutions that have multiple projects and as much packages installed, going through the csproj files to migrate them over to the Directory.Packages.props file could be quite a time-consuming task.
So it would be great if we could "migrate" packages from a project to this file. For example, there could be a "Move to Directory.Packages.props file" option accessed from the context menu on the installed package in the solution explorer that would create an entry into the Directory.Packages.props file and remove the version from the one in the csproj (or only the last part if the package was already in the props file.
In cases where the version would differ from the one in the props file, a prompt could confirm if we wish to overwrite with the selected version, use the one from the props file, or cancel
There are probably cases I didn't cover, but the general idea is there and I'm sure we'd benefit from having this option.
Additional Context and Details
No response
The text was updated successfully, but these errors were encountered: