OutWit.Common.Plugins.Abstractions
1.1.1
dotnet add package OutWit.Common.Plugins.Abstractions --version 1.1.1
NuGet\Install-Package OutWit.Common.Plugins.Abstractions -Version 1.1.1
<PackageReference Include="OutWit.Common.Plugins.Abstractions" Version="1.1.1" />
<PackageVersion Include="OutWit.Common.Plugins.Abstractions" Version="1.1.1" />
<PackageReference Include="OutWit.Common.Plugins.Abstractions" />
paket add OutWit.Common.Plugins.Abstractions --version 1.1.1
#r "nuget: OutWit.Common.Plugins.Abstractions, 1.1.1"
#:package OutWit.Common.Plugins.Abstractions@1.1.1
#addin nuget:?package=OutWit.Common.Plugins.Abstractions&version=1.1.1
#tool nuget:?package=OutWit.Common.Plugins.Abstractions&version=1.1.1
OutWit.Common.Plugins.Abstractions
This package contains the minimal set of shared interfaces, base classes, and attributes required to build plugins compatible with the OutWit.Common.Plugins system. It is intentionally lightweight to ensure your plugins do not depend on the main loader logic.
Key Components
IWitPlugin: The core interface that every plugin must implement. It defines the plugin lifecycle with methods for initialization, post-initialization, and unloading.WitPluginBase: An abstract base class that provides a default empty implementation ofIWitPluginfor convenience. You can override only the methods you need.[WitPluginManifestAttribute]: A mandatory attribute for any plugin class. It defines essential metadata like the plugin's unique name, version, and load priority, making it discoverable by the plugin loader.[WitPluginDependencyAttribute]: An optional attribute that can be used multiple times to declare dependencies on other plugins. It allows the loader to validate that required plugins are present before loading.
Installation
Add the package to your plugin's class library project using NuGet.
dotnet add package OutWit.Common.Plugins.Abstractions
How to Create a Plugin
- Create a new class library project.
- Add a reference to
OutWit.Common.Plugins.Abstractions. - Create a class that inherits from
WitPluginBase(or directly implementsIWitPlugin). - Add the
[WitPluginManifestAttribute]to your class, specifying a unique name. - If needed, add
[WitPluginDependencyAttribute]attributes to declare dependencies. - Implement the
InitializeandOnInitializedmethods to register services and execute logic.
Example
C#
using Microsoft.Extensions.DependencyInjection;
using OutWit.Common.Plugins.Abstractions;
using OutWit.Common.Plugins.Abstractions.Attributes;
using OutWit.Common.Plugins.Abstractions.Interfaces;
using System;
[WitPluginManifest("MyFirstPlugin", Version = "1.0.0", Priority = 100)]
[WitPluginDependency("AnotherPlugin", MinimumVersion = "2.1.0")]
public class MyFirstPlugin : WitPluginBase
{
// Use for registering services in DI.
public override void Initialize(IServiceCollection services)
{
// Register services in the DI container
services.AddSingleton<MyService>();
}
// Called after all plugins have been initialized.
public override void OnInitialized(IServiceProvider serviceProvider)
{
// Logic that runs after all plugins are loaded
var myService = serviceProvider.GetRequiredService<MyService>();
myService.Run();
}
// Called just before the plugin is about to be unloaded.
public override void OnUnloading()
{
// Perform cleanup here
}
}
License
Licensed under the Apache License, Version 2.0. See LICENSE.
Attribution (optional)
If you use OutWit.Common.Plugins.Abstractions in a product, a mention is appreciated (but not required), for example: "Powered by OutWit.Common.Plugins.Abstractions (https://ratner.io/)".
Trademark / Project name
"OutWit" and the OutWit logo are used to identify the official project by Dmitry Ratner.
You may:
- refer to the project name in a factual way (e.g., "built with OutWit.Common.Plugins.Abstractions");
- use the name to indicate compatibility (e.g., "OutWit.Common.Plugins.Abstractions-compatible").
You may not:
- use "OutWit.Common.Plugins.Abstractions" as the name of a fork or a derived product in a way that implies it is the official project;
- use the OutWit.Common.Plugins.Abstractions logo to promote forks or derived products without permission.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.2)
- OutWit.Common (>= 1.3.2)
-
net6.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- OutWit.Common (>= 1.3.2)
-
net7.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- OutWit.Common (>= 1.3.2)
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.7)
- OutWit.Common (>= 1.3.2)
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.7)
- OutWit.Common (>= 1.3.2)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on OutWit.Common.Plugins.Abstractions:
| Package | Downloads |
|---|---|
|
OutWit.Common.Plugins
A robust and flexible plugin system for .NET. Features dynamic discovery from directories, sophisticated dependency resolution (validates versions and detects circular dependencies), and isolated loading via AssemblyLoadContext to enable hot-reloading and unloading of plugins. |
|
|
OutWit.Engine.Interfaces
Core interface definitions and contracts for the WitEngine distributed computing system. Provides interfaces for activities, variables, jobs, processing, benchmarking, and plugin development. |
GitHub repositories
This package is not used by any popular GitHub repositories.