-
Notifications
You must be signed in to change notification settings - Fork 252
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
Provide a way to use CPM in an incremental mode #12768
Comments
See also #12316 for a previous request for this functionality from the community. |
This isn't technically/pedentically true. A single project is all-or-nothing, but anyone is free to (ab)use MSBuild to enable/disable CPM on specific projects, parts of a directory tree, etc. But it requires someone to understand MSBuild's scripting language and hand edit the files appropriately. Though as far as MSBuild goes, the knowledge required is fairly basic (look at the docs for "well known properties" and the docs on conditions, and/or the docs on multi-level merging of directory.build.props&tarets files; the same info applies to directory.packages.props) |
For more specifics, some SDKs such as This would also be a similar case for NuGet packages, SDKs, or libraries that make use of MSBuild targets/tasks to do similar mechanisms. It would be nice for both SDK owners and SDK consumers to be able to incrementally use CPM rather than having to know deep MSBuild knowledge just to use the feature. That's a huge gap today in understanding. |
My example: I maintain a set of class libraries. I want the class libraries to use lowest-necessary version, so users can choose any version from that and up. But at the end of the day, there's just a small subset of nuget packages that every single project reference, and they should all be the same version - those are the ones I want to manage centrally - the rest I want to just manage in each project head. So what I'd like to see:
|
This might deserve a separate issue, but I'd also like to add that it would be nice to be able to enable Transitive Pinning incrementally. For some large repos, it can be difficult to get all packages in a state where there are no conflicts. You can selectively enable it in certain parts of the tree (using This would be incredibly useful when addressing vulnerabilities in common packages like Something like the following would be extremely time saving and would prevent us from having to sprinkle direct dependencies all over to upgrade transitive dependencies: <PackageVersion Include="System.Drawing.Common" Version="5.0.3" PinTransitively="true" /> |
Comparing to centralized package management, I think a "centralized package version override" feature would be more useful. |
This is what had me stumped. You can't adopt CPM unless all projects remove the "Version" from the package reference. Why!!!! It would be much more usefull to have the CPM version always override the Version in the project, and also have a VersionOverride option in the project for cases where it is absolutely neceessary to have a specific version. Now I am faced with a "solution" consisting of 100 projects that I have to go by everyone to remove versions beofre repaping any possible benefits. |
NuGet Product(s) Involved
Visual Studio Package Management UI, MSBuild.exe, dotnet.exe, NuGet SDK
The Elevator Pitch
For complex repositories that would like to adopt CPM, today it is all-or-nothing. The elevator pitch would be to have some type of "incremental" mode in which CPM can be respected by those packages that onboard a
<PackageVersion>
and lackVersion
in their<PackageReference>
.Perhaps a new mode such as
<ManagePackageVersionsCentrallyMode>
could have anincremental
parameter or similar?Additional Context and Details
No response
The text was updated successfully, but these errors were encountered: