NetworkInspector.Licensing
0.23.0
dotnet add package NetworkInspector.Licensing --version 0.23.0
NuGet\Install-Package NetworkInspector.Licensing -Version 0.23.0
<PackageReference Include="NetworkInspector.Licensing" Version="0.23.0" />
<PackageVersion Include="NetworkInspector.Licensing" Version="0.23.0" />
<PackageReference Include="NetworkInspector.Licensing" />
paket add NetworkInspector.Licensing --version 0.23.0
#r "nuget: NetworkInspector.Licensing, 0.23.0"
#:package NetworkInspector.Licensing@0.23.0
#addin nuget:?package=NetworkInspector.Licensing&version=0.23.0
#tool nuget:?package=NetworkInspector.Licensing&version=0.23.0
NetworkInspector.Licensing
License inventory for any .NET application. The package depends on nothing but the .NET runtime.
An application ships its own code and many components, each under a license. A person who installs it should see every license and accept exactly that set. This package holds the set as one inventory: one entry per shipped thing with its license facts, a strict JSON form that a build writes and an application reads, and a hash that names the set a person accepted.
What you get
| Type | What it is |
|---|---|
LicenseEntry |
One shipped thing: kind, name, version, license (SPDX expression or custom), holder, full text, optional link and required-by |
LicenseEntryKind |
application, component, runtime, asset, plugin, pluginDependency |
LicenseInventory |
The set in one fixed order, each equal entry once; Write to JSON, TryRead from a stream with a size bound, TryReadEmbedded from an assembly, Merge |
LicenseHash |
Compute (SHA-256 over six facts), Short (sha256 9c41…e07b), NormalizeText |
JSON form
The resource name in an assembly is NetworkInspector.Licenses.json. Every member is required; an unknown member, a missing
member, and null in a fact member are refused; the depth is at most 8. The writer uses two spaces and LF.
{
"formatVersion": 1,
"entries": [
{
"kind": "component",
"name": "Avalonia",
"version": "12.1.0",
"license": "MIT",
"holder": "Copyright (c) AvaloniaUI OÜ",
"text": "Permission is hereby granted, …",
"link": "https://avaloniaui.net/",
"requiredBy": null
}
]
}
Entry rules: name 1 to 256 characters, version 1 to 128, license and holder 1 to 1,024, text not empty, link an absolute http or
https address of at most 2,048 characters or null, required-by 1 to 256 characters or null.
Hash
The hash covers six facts per entry: kind, name, version, license, holder, and the normalized text. Link and required-by do
not count. Normalization turns CRLF and CR into LF, removes spaces and tabs at line ends, and removes empty lines at the end.
The entries are sorted ordinal by kind, name, version, license, holder, text; equal facts count once. Each fact is framed by
its UTF-8 byte count (4 bytes, little-endian), so ("ab", "c") and ("a", "bc") differ. Short shows the first and the last
four of the 64 hexadecimal characters.
Quickstart
Prerequisites: .NET 10 or later.
using NetworkInspector.Licensing;
LicenseInventory inventory = new([
new LicenseEntry(LicenseEntryKind.Component, "Lib", "1.0", "MIT", "Copyright (c) Someone", "MIT license text", null, null),
]);
using MemoryStream stream = new();
inventory.Write(stream);
stream.Position = 0;
if (LicenseInventory.TryRead(stream, maxBytes: 16 * 1024 * 1024, out LicenseInventory? read, out string? problem))
{
Console.WriteLine(LicenseHash.Short(LicenseHash.Compute(read.Entries)));
}
else
{
Console.WriteLine(problem);
}
maxBytes is the caller's limit: the size of an inventory is untrusted input when it comes from a plugin.
Build and test
dotnet build NetworkInspector.Licensing/NetworkInspector.Licensing.csproj -c Release
dotnet test --project NetworkInspector.Licensing.Tests/NetworkInspector.Licensing.Tests.csproj -c Release
Documentation
License
MIT. See the license in the repository root.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on NetworkInspector.Licensing:
| Package | Downloads |
|---|---|
|
NetworkInspector.Plugins.Loader
Plugin scan by metadata, load by application-defined kinds, bounded plugin calls, and lifecycle. |
|
|
NetworkInspector.BaseApp.Core
The UI-free core of a base application: identity, typed commands with one pipeline, a license gate, generic plugins, settings and profiles, messages and a log file, jobs, texts in several languages, shared UI state, and row sources for huge growing lists. It references no web or desktop framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.23.0 | 0 | 11/26/2026 |