Package update helper
NuGet and Directory.Packages.Props

In my day job, we own several common libraries. The common libraries my contain additional dependencies that we own such as HTTP clients or other providers. It’s a pain when we have a chain of dependencies which all need to be updated.
We use Central Package Management (CPM). In other instances we may need to debug though the source code of the common libraries and symbols processing doesn’t work correctly. A script to convert from PackageReferences to ProjectReferences can help.
I wrote this script to help ease the pain:
Each source push will kick off a CI/CD pipeline and each repository depending on it’s dependencies must wait until a pre-release version is available on NuGet/Package servers. Once available, we can update our PackageReferences using this script, commit, and push and cycle repeats until the chain of dependencies are updated.
Some learnings:
- When someone pushes a new version of a prerelease with same version, it will pull that version. There is no history of any versions that can be evaluated.
- When using
--takeor--skip, it doesn't work with--exact-match. Regardless, the search with the former doesn't work as expected sometimes. Better to use--takewith the full package name.
This is a starting point for fully automating the process which could include Agentic AI.




