NetworkInspector.Licensing.Build 0.23.0

dotnet add package NetworkInspector.Licensing.Build --version 0.23.0
                    
NuGet\Install-Package NetworkInspector.Licensing.Build -Version 0.23.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NetworkInspector.Licensing.Build" Version="0.23.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NetworkInspector.Licensing.Build" Version="0.23.0" />
                    
Directory.Packages.props
<PackageReference Include="NetworkInspector.Licensing.Build">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NetworkInspector.Licensing.Build --version 0.23.0
                    
#r "nuget: NetworkInspector.Licensing.Build, 0.23.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NetworkInspector.Licensing.Build@0.23.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NetworkInspector.Licensing.Build&version=0.23.0
                    
Install as a Cake Addin
#tool nuget:?package=NetworkInspector.Licensing.Build&version=0.23.0
                    
Install as a Cake Tool

NetworkInspector.Licensing.Build

Build-time license inventory for .NET applications and plugins. At every build whose inputs changed, the package determines license, holder, and text of every shipped package, project, framework, and declared asset, offline from the restore output, and embeds them as the resource NetworkInspector.Licenses.json (read it with LicenseInventory.TryReadEmbedded of NetworkInspector.Licensing). A fact that cannot be determined fails the build.

Install

<PackageReference Include="NetworkInspector.Licensing.Build" Version="0.22.0" />

The package is a development dependency (PrivateAssets="all" is automatic): it never appears in your own inventory and never flows to your consumers. Your project is an entry of its own inventory, so state its facts:

<PropertyGroup>
  <Authors>Example</Authors>
  <PackageLicenseExpression>MIT</PackageLicenseExpression>
  <Copyright>Copyright (c) 2026 Example</Copyright>
</PropertyGroup>

Kinds

NiLicenseKind is Application for an executable, Component for a library, or Plugin. An application gets one runtime entry per shared framework (Microsoft.NETCore.App, Microsoft.AspNetCore.App); its version is the framework band of the target framework (10.0), never a patch version, so a rebuild on another machine keeps the license hash. A plugin's dependencies have the kind pluginDependency.

Plugins

A ProjectReference with Private="false" is provided by the host at run time: the application's inventory covers it, so the plugin's inventory leaves it and its closure out. Do not ship those files with the plugin; copies in the plugin folder are ignored by the loader.

What counts as shipped

The collector walks direct package and project references and their dependencies breadth-first. Private runtime packages count in the project that consumes them. A package that ships no file (runtime, native, runtimeTargets, resource, or contentFiles, without _._ placeholders), such as an analyzer or a build-only package, is not listed, but its dependencies are.

Assets

Files that are no package, such as a font, are declared with their facts:

<ItemGroup>
  <NiLicenseAsset Include="assets/font-license.txt" Name="Some Font" Version="2.0" License="OFL-1.1" Holder="Copyright (c) Font Author" />
</ItemGroup>

The collector follows shipped project references transitively. A library declares its bundled font once. The host lists assets of host-provided libraries, and plugins omit those assets.

Overrides

When a package does not state a fact, state it in licenses.overrides.json next to the project (or set NiLicenseOverridesFile). An override holds for its exact version only; a new version must be checked again.

{ "formatVersion": 1, "overrides": [ { "name": "Some.Package", "version": "1.2.3",
  "license": "MIT", "holder": "Some Author", "textFile": "licenses/Some.Package.txt", "link": null } ] }

textFile is relative to the override file and must lie in a licenses/ folder next to it (a changed text there rebuilds the inventory; a text elsewhere fails the build with NILIC003). A fact that is null keeps what the package states.

Microsoft.NETCore.App and Microsoft.AspNetCore.App use their framework band and bundled attribution. Other frameworks need a version-specific override matching the resolved targeting pack.

Errors

Code Meaning Fix
NILIC001 {name} {version}: {license, holder, or text} unknown State the fact in licenses.overrides.json (for your own project: set PackageLicenseExpression or Copyright)
NILIC002 A package's license file path leaves the package folder; nothing is read Report the package; state its text with an override
NILIC003 An input cannot be read (assets file, facts files, overrides, a text above 16 MiB, an inventory above 16 MiB) Restore again, or fix the named file
NILIC004 A declared asset misses a fact or its text file Complete the NiLicenseAsset item
NILIC005 The license tool was not found Restore the package again

A failed run deletes the old inventory, so a stale one is never embedded.

Turn off

<NiLicenseCollect>false</NiLicenseCollect> turns the collection off (test projects have it off already).

Build and test

dotnet build NetworkInspector.Licensing.Build/NetworkInspector.Licensing.Build.csproj -c Release
dotnet test --project NetworkInspector.Licensing.Tests/NetworkInspector.Licensing.Tests.csproj -c Release
dotnet pack NetworkInspector.Licensing.Build/NetworkInspector.Licensing.Build.csproj -c Release

Documentation

Architecture: Licensing.Build · Decision: license build tool · Bundled assets

License

MIT. See the license in the repository root. The standard license texts under texts/ are the texts of their licenses from the SPDX license list data.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.23.0 0 11/26/2026