Support NuGet Central Package Management
See original GitHub issueFor solutions using the new NuGet Central Packagement feature, trying the --upgrade
option will cause dotnet-outdated to add the package versions to the csproj
package references, rather than updating the package versions in Directory.Packages.props
, and consequently break the build. A simplified example of how this manifests is shown below.
Updating the tool to support this NuGet feature would allow such projects to leverage the --upgrade
option, rather than just needing to manually update using the console’s output as a guide on what to update.
Happy to help-out with getting this supported!
Before
Directory.Packages.Props
<Project>
<ItemGroup>
<PackageVersion Include="Newtonsoft.Json" Version="12.0.2" />
</ItemGroup>
</Project>
Project.csproj
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" />
</ItemGroup>
</Project>
After
Directory.Packages.Props
<Project>
<ItemGroup>
<PackageVersion Include="Newtonsoft.Json" Version="12.0.2" />
</ItemGroup>
</Project>
Project.csproj
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.3</Version>
<PackageReference>
</ItemGroup>
</Project>
Issue Analytics
- State:
- Created 3 years ago
- Reactions:13
- Comments:14 (5 by maintainers)
Top Results From Across the Web
Introducing Central Package Management - The NuGet Blog
Central Package Management. Dependency management is a core feature of NuGet. Managing dependencies for a single project can be easy.
Read more >Centrally managing NuGet package versions
In addition only specific types of projects will be supported for Central Package Version Management. Refer to this to see the exclusions.
Read more >NuGet Central Package Management Comes To JetBrains ...
CPM allows developers to manage NuGet dependencies in a .NET solution from a central location. This can simplify the upgrade process of ...
Read more >Central Package Management for .NET Projects
It's a way of controlling versions of NuGet packages in a centralized location. This solution follows the modern pattern of using Directory.*.
Read more >Simplify NuGet Package Versions in your application with ...
In this post we're going to walk through using Central Package Management to simplify how you manage versions of your NuGet dependencies.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello all.
Just wanted to hop in and say that I’d really like this feature to be implemented and would be happy to help any way I can. I use central package management in all my projects, since it simplifies managing versions on >1 project solutions.
For dotnet-affected, we implemented a feature where we can detect which projects are affected by adding/deleting/updating a nuget package. I think that works great together with
dotnet-outdated
: you update all your packages, and then in CI or locally you only build/test/publish the projects that were changed/affected by the package changes.I wanted to share our implementation for reading
Directory.Packages.props
, which uses MSBuild in order to do so. This supports conditions as well, which is quite nice to have (we use conditions in props files for multi framework targeting)We also have tests where we create
Directory.Packages.props
files, see here Particularly, we ensure conditions are interpretedThis is the code we use for updating packages, I wouldn’t use that in production (its for testing only) but perhaps we can get some inspiration for dotnet-outdated.
Should we create a package to share this code between these two tools?
Regards, Leo.
@martincostello that would be a great addition. We would welcome this functionality.