A command line analysis tool for your nuget package configs and project references.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
build
src
.gitattributes
.gitignore
NugetXray.sln
global.json
readme.md

readme.md

NugetXray

NuGet Gitter

NugetXray is a command line tool that analyses your nuget and project references. It contains commands that help you see how out of date your packages are, diagnose issues with multiple versions of the same package, and more.

Installation

NugetXray itself is a package available from nuget. It has been compiled down to a native executable so a dotnet core installation is not needed.

You can also download a zip from the releases page.

> nuget install NugetXray

You can access the executable in the tools folder.

> cd .\NugetXray*\tools
> .\NugetXray.exe

Building from source

You can clone this repository and create your own package using the build script.

This application is built with dotnet core so you will need to install the appropriate tools for your platform.

> cd build
> .\build.ps1

Commands

Diff

The diff command lets you see how out of date your packages are. It will read all the package.configs in your solution and compare them to whats available in the package source. By default it will compare against nuget.org.

> .\NugetXray.exe diff -d C:\git\ConveyorBelt\
Scanning https://www.nuget.org/api/v2 for packages.configs.
WindowsAzure.Storage.2.1.0.4                                           | -5.0.0      | 3   configs
Newtonsoft.Json.6.0.8                                                  | -3.0.0      | 4   configs
WindowsAzure.Storage.4.3.0                                             | -3.0.0      | 1   configs

You can also get more detailed output by using the verbose switch.

> .\NugetXray.exe diff -d C:\git\ConveyorBelt\ -v
Scanning https://www.nuget.org/api/v2 for packages.configs.
WindowsAzure.Storage.2.1.0.4 | -5.0.0
  C:\git\ConveyorBelt\src\ConveyorBelt.ConsoleWorker\packages.config
  C:\git\ConveyorBelt\src\ConveyorBelt.Tooling\packages.config
  C:\git\ConveyorBelt\src\ConveyorBelt.Worker\packages.config

Newtonsoft.Json.6.0.8 | -3.0.0
  C:\git\ConveyorBelt\src\ConveyorBelt.ConsoleWorker\packages.config
  C:\git\ConveyorBelt\src\ConveyorBelt.Tooling\packages.config
  C:\git\ConveyorBelt\src\ConveyorBelt.Worker\packages.config
  C:\git\ConveyorBelt\test\ConveyorBelt.Tooling.Test\packages.config

A negative exit code is returned which you can use to fail your build. It is the number of packages which are one or more major versions behind.

Duplicate

The duplicate command finds multiple versions of the same package. Multiple versions should be consolidated to a single version to avoid runtime issues.

> .\NugetXray.exe duplicate -d C:\git\ConveyorBelt\
Scanning C:\git\ConveyorBelt\ for packages.configs.
WindowsAzure.Storage                                                   | 2 versions

Errors:   1

You can also get more detailed output by using the verbose switch.

> .\NugetXray.exe duplicate -d C:\git\ConveyorBelt\ -v
Scanning C:\git\ConveyorBelt\ for packages.configs.
WindowsAzure.Storage | 2 versions
  (2.1.0.4, C:\git\ConveyorBelt\src\ConveyorBelt.ConsoleWorker\packages.config)
  (2.1.0.4, C:\git\ConveyorBelt\src\ConveyorBelt.Tooling\packages.config)
  (2.1.0.4, C:\git\ConveyorBelt\src\ConveyorBelt.Worker\packages.config)
  (4.3.0, C:\git\ConveyorBelt\test\ConveyorBelt.Tooling.Test\packages.config)

Errors:   1

A negative exit code is returned which you can use to fail your build. It is the number of packages which have duplicate versions.

Issues and feature requests

Please start raise an issue on github for any bugs or features you would like to see.