nuget-license 4.0.2

dotnet tool install --global nuget-license --version 4.0.2
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local nuget-license --version 4.0.2
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=nuget-license&version=4.0.2
                    
nuke :add-package nuget-license --version 4.0.2
                    

Nuget License Utility Tests Quality Gate Status NuGet

Nuget License Utility is a tool to analyze, print, and validate the licenses of dependencies in .NET and C++ projects. It supports .NET (Core), .NET Standard, .NET Framework, and native C++ projects.

Features

  • Analyze project or solution files for NuGet package licenses
  • Validate licenses against an allowed list
  • Download license files for auditing
  • Supports transitive dependencies, custom mappings, and overrides
  • Flexible output: table or JSON (pretty/minified)
  • Exclude or ignore specific packages or projects
  • Works with .NET Core, .NET Framework, and native C++ projects

Project Structure

This repository provides two main tools:

Tool Description Supported Project Types
NuGetLicenseCore<br/>(dotnet tool) Cross-platform .NET Core global tool, installed via dotnet tool install. .NET Core, .NET Standard, partial .NET Framework<sup>1</sup>
NuGetLicenseFramework.exe Standalone .NET Framework executable. .NET Core, .NET Standard, .NET Framework, native C++

<sup>1</sup> .NET Framework support via the dotnet tool may vary due to MSBuild/environment differences.

Compatibility Matrix

Tool .NET Core .NET Standard .NET Framework Native C++
NuGetLicenseCore<br/>(dotnet tool) ✔️ ✔️ ⚠️<br/>Partial support
NuGetLicenseFramework.exe ✔️ ✔️ ✔️ ✔️

Installation

NuGetLicenseCore (dotnet tool)

dotnet tool install --global nuget-license

NuGetLicenseFramework.exe

Download the latest release from GitHub Releases and run the executable directly.

Usage

Basic Command

nuget-license [options]

Common Options

Option Description
--version Show version information.
-i, --input <FILE> Project or solution file to analyze.
-ji, --json-input <FILE> JSON file with an array of project/solution files to analyze. See docs/input-json.md.
-t, --include-transitive Include transitive dependencies.
-a, --allowed-license-types <FILE> JSON file listing allowed license types. See docs/allowed-licenses-json.md.
-ignore, --ignored-packages <FILE> JSON file listing package names to ignore (supports wildcards). See docs/ignored-packages-json.md.
-mapping, --licenseurl-to-license-mappings <FILE> JSON dictionary mapping license URLs to license types. See docs/licenseurl-mappings-json.md.
-file-mapping, --licensefile-to-license-mappings <FILE> JSON dictionary mapping license files to license types. Paths are relative to the JSON file. See docs/licensefile-mappings-json.md.
-override, --override-package-information <FILE> JSON list to override package/license info. See docs/override-package-json.md.
-d, --license-information-download-location <FOLDER> Download all license files to the specified folder.
-o, --output <TYPE> Output format: Table, Markdown, Json or JsonPretty (default: Table).
-err, --error-only Only show validation errors.
-include-ignored, --include-ignored-packages Include ignored packages in output.
-exclude-projects, --exclude-projects-matching <PATTERN\|FILE> Exclude projects by name or pattern (supports wildcards or JSON file). See docs/exclude-projects-json.md.
-isp, --include-shared-projects Include shared projects (.shproj).
-f, --target-framework <TFM> Analyze for a specific Target Framework Moniker.
-fo, --file-output <FILE> Write output to a file instead of console.
-?, -h, --help Show help information.

Examples

Show Help

nuget-license --help

Validate licenses for a project

nuget-license -i MyProject.csproj

Validate licenses for a solution

nuget-license -i MySolution.sln

Use a custom allowed license list

nuget-license -i MyProject.csproj -a allowed-licenses.json

Generate pretty JSON output

nuget-license -i MyProject.csproj -o JsonPretty

Download all license files

nuget-license -i MyProject.csproj -d licenses/

Map license files to license types

nuget-license -i MyProject.csproj -file-mapping license-file-mappings.json

Note: License file paths in the JSON are relative to the JSON file's directory.

Advanced Usage

  • Multiple projects: Use -ji with a JSON file listing multiple projects/solutions.
  • Override package info: Use -override to supply custom license info for specific packages.
  • Ignore packages: Use -ignore to skip in-house or known packages.
  • Exclude projects: Use -exclude-projects to skip test or sample projects.

Building from Source

  1. Clone the repository.
  2. Build with your preferred .NET SDK.
  3. For the dotnet tool: dotnet pack NuGetLicenseCore
  4. For the framework exe: build NuGetLicenseFramework and use the resulting .exe.

License

See LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
4.0.2 4,374 12/2/2025
4.0.2-beta.1 132 11/24/2025
4.0.1 22,918 11/12/2025
4.0.1-beta.2 88 11/7/2025
4.0.0 63,123 9/20/2025
4.0.0-beta.2 421 9/17/2025
4.0.0-beta.1 220 9/15/2025
3.1.7 40,907 8/21/2025
3.1.6 49,109 7/4/2025
3.1.4 44,860 6/2/2025
3.1.3 71,297 3/17/2025
3.1.2 11,405 3/6/2025
3.1.1 22,929 2/5/2025
3.1.0 3,341 2/3/2025
3.0.15 134,171 12/27/2024
3.0.14 11,163 12/11/2024
3.0.13 130,151 9/18/2024
3.0.12 993 9/16/2024
3.0.11 247 9/16/2024
3.0.10 3,375 9/4/2024
3.0.9 33,363 8/15/2024
3.0.9-beta.3 116 8/14/2024
3.0.9-beta.2 136 8/14/2024
3.0.9-beta.1 119 8/14/2024
3.0.8 1,952 8/12/2024
3.0.7 878 8/7/2024
3.0.6 3,131 7/25/2024
3.0.5 8,198 7/10/2024
3.0.4 1,885 7/4/2024
3.0.3 39,042 4/9/2024
3.0.3-beta.4 3,880 3/4/2024
3.0.3-beta.3 142 2/27/2024
3.0.2 10,047 2/20/2024
3.0.1 12,207 1/8/2024
3.0.0 1,995 12/9/2023
3.0.0-alpha.10 135 12/9/2023