NetworkInspector.Plugins.Abstractions 0.23.0

dotnet add package NetworkInspector.Plugins.Abstractions --version 0.23.0
                    
NuGet\Install-Package NetworkInspector.Plugins.Abstractions -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.Plugins.Abstractions" Version="0.23.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NetworkInspector.Plugins.Abstractions" Version="0.23.0" />
                    
Directory.Packages.props
<PackageReference Include="NetworkInspector.Plugins.Abstractions" />
                    
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.Plugins.Abstractions --version 0.23.0
                    
#r "nuget: NetworkInspector.Plugins.Abstractions, 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.Plugins.Abstractions@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.Plugins.Abstractions&version=0.23.0
                    
Install as a Cake Addin
#tool nuget:?package=NetworkInspector.Plugins.Abstractions&version=0.23.0
                    
Install as a Cake Tool

NetworkInspector.Plugins.Abstractions

NuGet .NET 10 License: MIT

The generic plugin contract that every application on the NetworkInspector plugin system shares. An application defines one or more plugin kinds: an interface that derives from IPluginModule<TBuilder> and a builder that derives from IPluginBuilderStage. A plugin is a class library with an entry type that carries [PluginEntry] and implements the interface of a kind. NetworkInspector.Plugins.Loader reads the entry, version, host requirement, and licenses from the plugin file without loading it, and loads only plugins of kinds the application defines. Network Inspector's own kind is NetworkInspector.Plugins. How an application defines and loads its own kinds: plugin guide § 14.

Install

dotnet add package NetworkInspector.Plugins.Abstractions

The application that loads a plugin already contains this package; reference it from a plugin with Private="false" in a project reference (or exclude its runtime assets in a package reference): the application provides it at run time, and a copy in the plugin folder is ignored by the loader.

Write a plugin kind

A kind is a contract assembly of the application: one interface and one builder. The builder collects what a plugin declares while it is configured; the loader commits it when the plugin configured without a failure and discards it otherwise, so a failing plugin leaves nothing behind.

namespace Sample.Application.Contract
{
    public sealed class SamplePluginBuilder : IPluginBuilderStage
    {
        private readonly ContributionRecorder _Recorder;
        public SamplePluginBuilder(string pluginName, ContributionRecorder recorder) { PluginName = pluginName; _Recorder = recorder; }
        public string PluginName { get; }
        public bool Committed { get; private set; }
        public bool Discarded { get; private set; }
        public void Add(string item) { _Recorder.Record(new ContributionKind("item"), item, ""); }
        public void Commit()
        {
            // The loader decides: a plugin that calls this while it configures must not publish itself.
            if (_Recorder.IsConfiguring || Committed || Discarded)
            {
                throw new InvalidOperationException("The builder is sealed or its plugin is still configuring.");
            }

            Committed = true;
        }

        public void Discard()
        {
            if (_Recorder.IsConfiguring)
            {
                throw new InvalidOperationException("A plugin cannot discard its own builder.");
            }

            Discarded = true;
        }
    }

    public interface ISamplePlugin : IPluginModule<SamplePluginBuilder> { }
}

ContributionRecorder comes from the loader: the application passes it to its builder so plugins list can show what each plugin added. The kind is named when the application declares it to the loader (sample); a kind name is 1–64 lower-case letters and digits starting with a letter.

Write a plugin

[PluginEntry("Acme.Counter", "Acme counter", "Counts Acme frames.")]
[PluginRequiresHost("1.0.0", MaximumExclusive = "2.0.0")]
public sealed class AcmeCounterPlugin : ISamplePlugin
{
    public void Configure(SamplePluginBuilder builder) => builder.Add("acme.counter");
}

The entry type is public, not abstract, not generic, has a public parameterless constructor, and lists the kind's interface in its own interface list. StartAsync and StopAsync of IPluginModule are optional; their defaults do nothing.

Value Rule
Name 1–256 characters of dot-separated identifiers (letters, digits, underscores): Acme.Counter. The only value that must be unique; it compares ignoring case and names the plugin's data folder
UI name 1–100 characters without control characters
Description At most 1,000 characters; line breaks are the only control characters allowed; may be empty

A plugin that breaks a rule is listed as skipped with the reason and never loaded. A reason repeats at most 64 characters of a name, with control characters written as \uXXXX, and never repeats a description.

Version and host requirement

The plugin's version is the informational version of its assembly (<Version> in the project file) without its build metadata: 1.4.0-beta.2+3f2a1c is version 1.4.0-beta.2. It must be a semantic version; 1.4 is listed as skipped.

[PluginRequiresHost(minimum, MaximumExclusive = maximum)] states the application versions the plugin runs on: [PluginRequiresHost("2.0.0", MaximumExclusive = "3.0.0")] reads 2.0.0 ≤ host < 3.0.0. Without the attribute the plugin runs on every version. Both values must be semantic versions, and the maximum must be above the minimum.

SemanticVersion follows SemVer 2.0.0:

Rule Example
Three numeric parts without leading zeros, each at most 2,147,483,647 1.10.0; 1.0 and 01.2.3 are refused
Optional pre-release of dot-separated identifiers (letters, digits, dashes) 1.0.0-beta.1; 1.0.0-a..b is refused
Build metadata is accepted and dropped 1.0.0+abc equals 1.0.0
At most 256 characters a longer text is refused
Numbers compare numerically 1.9.0 < 1.10.0
A pre-release ranks below its release 2.0.0-rc.1 < 2.0.0
Numeric identifiers rank below alphanumeric ones and compare by value 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-beta.x

What the contract contains

Type Purpose
PluginEntryAttribute marks the entry type: name, UI name, description
PluginRequiresHostAttribute the application versions a plugin runs on
SemanticVersion parses and orders semantic versions
IPluginModule, IPluginModule<TBuilder> the plugin lifecycle (StartAsync, StopAsync) and the configure call of a kind
IPluginBuilderStage the builder of a kind: Commit after a clean configure, Discard after a failure
IPluginContext, IPluginLog what a started plugin gets from the application: log, data folder, settings, stop signal
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on NetworkInspector.Plugins.Abstractions:

Package Downloads
NetworkInspector.Plugins

Core-tier plugin contract: entry point, builder, context, source and exporter registrations.

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