The package management features within Visual Studio are fantastic when working within a single solution. It lets you know when there are new packages available and you are referencing multiple versions of the same package. There are some scenarios which could be improved:
Some of our applications have code distributed across different repositories and packages. Since these are different solutions its difficult to use existing tools to detect when these packages are getting out of sync. NugetXray has commands to do just that.
It’s available at nuget.org.
There are currently two commands: one to find out of date packages and another to find package version mismatches.
To generate a diff report:
This shows us how many major, minor or patch versions we are behind by. You can generate a report across multiple repositories by setting the directory parameter to the root of both repositories.
You can also output either json or html if you want to build further tooling around it. The html report can included as a third party teamcity report.
To find whether you have multiple versions of the same package, you can run the duplicate command.
As before you can include multiple solutions under a single root directory to find duplicates across solutions. It also supports both Json and Html output.
If you want to integrate it with your build process, and fail when there are packages which need updating or consolidating, you can use the exit code. If calling from PowerShell you can get by calling
$LASTEXITCODE. A negative exit code is returned to indicate there are results.
If you want more details output around the failures and which packages.config they refer to you can specify the