Skip to main content

A DotNet tool to build a license file including all nuget-packages referenced in a solution.

Total Downloads
6.5K
6,466
Published
Jan 7, 2025
1y ago

Get Started

dotnet add package TomsToolbox.LicenseGenerator --version 1.7.0

No framework information available.

README

License Generator

A DotNet tool to create a license file AKA NOTICE.TXT for all referenced nuget packages.

Build Nuget

This tool uses MSBuild logic to control which projects should be listed in the license file, giving you a high grade of flexibility.

All projects containing a property IsDeploymentTarget set to true and their dependencies are included in the license file.

You can mark individual projects by adding the IsDeploymentTarget property to the project file:

  • Include the project and all references:
    <IsDeploymentTarget>true</IsDeploymentTarget>

You can include several projects by convention by adding conditional properties in the Directory.Build.targets file:

  • Include all executables:
    <IsDeploymentTarget Condition="'$(IsDeploymentTarget)'=='' AND '$(IsTestProject)'!='True' AND '$(OutputType)'=='Exe'">true</IsDeploymentTarget>
  • Include all projects ending with Something:
    <_IsSomeProject>$(MSBuildProjectName.ToUpperInvariant().EndsWith("SOMETHING"))</_IsSomeProject>
    <IsDeploymentTarget Condition="'$(IsDeploymentTarget)'=='' AND $(_IsSomeProject)">true</IsDeploymentTarget>

Installation

dotnet tool install TomsToolbox.LicenseGenerator -g

Usage

build-license [options]

Options

  -i, --input <input> (REQUIRED)  The path to the solution file to process.
  -o, --output <output>           The name of the license file that is created.
                                  An existing file will be overwritten without confirmation.
                                  Default is Notice.txt in the same folder as the solution.
  -e, --exclude <exclude>         A regular expression to specify package ids to exclude from output.
  --recursive                     A flag to indicate that all dependencies should be scanned recursively.
  --offline                       A flag to indicate that only the locally cached packages should be scanned (requires a restore beforehand).
  --version                       Show version information
  -?, -h, --help                  Show help and usage information

Downloads by Version

Similar & Alternative Packages

Hand-picked matching NuGet libraries based on tags & ecosystem

Depended On By

Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.