All Projects → weikio → Pluginframework

weikio / Pluginframework

Licence: mit
Everything is a Plugin in .NET

Projects that are alternatives of or similar to Pluginframework

Bcrypt.net
BCrypt.Net - Bringing updates to the original bcrypt package
Stars: ✭ 422 (+114.21%)
Mutual labels:  nuget, netcore
Bridge
♠️ C# to JavaScript compiler. Write modern mobile and web apps in C#. Run anywhere with Bridge.NET.
Stars: ✭ 2,216 (+1024.87%)
Mutual labels:  roslyn, nuget
Fo Dicom
Fellow Oak DICOM for .NET, .NET Core, Universal Windows, Android, iOS, Mono and Unity
Stars: ✭ 674 (+242.13%)
Mutual labels:  nuget, netcore
SockNet
The easiest and fastest way to work with sockets in C#
Stars: ✭ 42 (-78.68%)
Mutual labels:  nuget, netcore
Zipstorer
A Pure C# Class to Store Files in Zip
Stars: ✭ 139 (-29.44%)
Mutual labels:  nuget, netcore
AspNetCore.Identity.RavenDb
RavenDB user/role persistent store for ASP.NET Core identity provider
Stars: ✭ 17 (-91.37%)
Mutual labels:  nuget, netcore
Latestversionplugin
LatestVersion Plugin for Xamarin and Windows apps
Stars: ✭ 99 (-49.75%)
Mutual labels:  plugin, nuget
MQTTnet
MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.
Stars: ✭ 3,309 (+1579.7%)
Mutual labels:  nuget, netcore
Unitconversion
Expansible Unit Conversion Library for .Net Core and .Net Framework
Stars: ✭ 139 (-29.44%)
Mutual labels:  nuget, netcore
Wkhtmltopdf.netcore
Rotativa + Net Core
Stars: ✭ 137 (-30.46%)
Mutual labels:  nuget, netcore
AspSqliteCache
An ASP.NET Core IDistributedCache provider backed by SQLite
Stars: ✭ 39 (-80.2%)
Mutual labels:  nuget, netcore
Megaapiclient
MegaApiClient is a C# .Net library to access http://mega.co.nz / http://mega.nz cloud storage and file hosting service.
Stars: ✭ 151 (-23.35%)
Mutual labels:  nuget, netcore
Extended-Toolkit
A companion toolkit for the standard toolkit.
Stars: ✭ 83 (-57.87%)
Mutual labels:  nuget, netcore
H.NotifyIcon.WPF
NotifyIcon for .Net Core 3.1 and .Net 5 WPF.
Stars: ✭ 44 (-77.66%)
Mutual labels:  nuget, netcore
doteasy.rpc
Inspired by microservices, a lightweight framework that looks like a rabbit, based on NET Core 2.0 Standard 2 core library
Stars: ✭ 62 (-68.53%)
Mutual labels:  roslyn, netcore
Gistlyn
Run Roslyn Gists
Stars: ✭ 75 (-61.93%)
Mutual labels:  roslyn, nuget
Cometary
Roslyn extensions, with a touch of meta-programming.
Stars: ✭ 31 (-84.26%)
Mutual labels:  roslyn, netcore
dark-sky-core
A .NET Standard Library for using the Dark Sky API.
Stars: ✭ 55 (-72.08%)
Mutual labels:  nuget, netcore
Colore
A powerful C# library for Razer Chroma's SDK
Stars: ✭ 121 (-38.58%)
Mutual labels:  nuget, netcore
Filepicker Plugin For Xamarin And Windows
FilePicker Plugin for Xamarin and Windows
Stars: ✭ 151 (-23.35%)
Mutual labels:  plugin, nuget
Plugin Framework Logo

Plugin Framework for .NET Core NuGet Version

With Plugin Framework for .NET Core, everything is a plugin! Plugin Framework is a plugin platform for .NET Core applications, including ASP.NET Core, Blazor, WPF, Windows Forms and Console apps. It is light-weight and easy to integrate and supports multiple different plugin catalogs, including .NET assemblies, Nuget packages and Roslyn scripts.

Main Features

Here are some of the main features of Plugin Framework:

  • Everything is a plugin! Deliver plugins as Nuget-packages, .NET assemblies, Roslyn scripts and more.
  • Easy integration into a new or an existing .NET Core application.
  • Automatic dependency management.
  • MIT-licensed, commercial support available.

Quickstart: Plugin Framework & ASP.NET Core

Plugin Framework is available from Nuget as a .NET Core 3.1 package. There's a separate package which makes it easier to work with plugins in an ASP.NET Core app:

NuGet Version

Install-Package Weikio.PluginFramework.AspNetCore

Using Plugin Framework can be as easy as adding a single new line into ConfigureServices:

services.AddPluginFramework<IOperator>(@".\myplugins");

The code finds all the plugins (types that implement the custom IOperator-interface) from the myplugins-folder. The plugins can be used in a controller using constructor injection:

public CalculatorController(IEnumerable<IOperator> operator)
{
	_operators = operators;
}

Alternatively, you can provide multiple plugin locations using catalogs:

var folderPluginCatalog = new FolderPluginCatalog(@".\myplugins", type =>
{
    type.Implements<IOperator>();
});

var anotherPluginCatalog = new FolderPluginCatalog(@".\morePlugins", type =>
{
    type.Implements<IOperator>();
});

services.AddPluginFramework()
    .AddPluginCatalog(folderPluginCatalog)
    .AddPluginCatalog(anotherPluginCatalog)
    .AddPluginType<IOperator>();

Samples

The following Plugin Framework samples are available from GitHub:

Plugin Framework & .NET Console Application

Plugin Framework & ASP.NET Core

Plugin Framework & Blazor

Plugin Framework & WPF App

Plugin Framework & WinForms App

Nuget & Plugin Framework & ASP.NET Core

Roslyn & Plugin Framework & ASP.NET Core

Delegates & Plugin Framework & ASP.NET Core

Tagging & WinForms App

AppSettings.json & ASP.NET Core

Background and introduction

For more details related to Plugin Framework's background, please see the following introduction article from InfoQ.

Main concepts

Using Plugin Framework concentrates around two concepts: Plugins and Plugin Catalogs.

Plugin

Plugins are software programs, which provide extensions to an application. Plugins are designed to work with a single application. This app is often called the host application. The host application is designed in such a way that it can locate and run plugins dynamically, runtime. The application works without the plugins, the plugins can't work without the host application.

The host application defines the specifications for the plugins. In some applications a plugin can add new functionality into the UI. In other apps, plugins are used to distribute logs into multiple different systems. The host application defines what kind of extensions it supports.

Plugin-based software architecture can help in the following scenarios:

  • Adding new features to application after the release
  • Splitting large systems into smaller parts
  • Updating always-on software system without restarting it

Plugins are dynamic, and they are often only loaded when the application needs them. Plugins are not usually compiled as part of the system but distributed as separate packages (assemblies, Nuget packages).

In the context of the Plugin Framework, plugin is a single .NET Type. What makes a plugin? As described previously, it depends on the host application. For some applications a plugin is a type which implements a specific interface. In some applications a plugin is a type which has a single public method called Run. Attributes are often used to indicate the plugins and that is also supported by Plugin Framework. From the Plugin Framework's point of view anything or everything can be a plugin.

As mentioned, in Plugin Framework a single plugin is a .NET Type. Even though Plugin Framework's ASP.NET Core support makes it easy to instantiate and use plugins in services and controllers through dependency injection (IServiceProvider), Plugin Framework itself doesn't provide any built-in mechanisms for creating instances (objects) from the plugins (types). In some cases Activator.CreateInstance is all that is needed and in some cases it is best to hook Plugin Framework with the app's DI-system. The requirements are host application specific.

In Plugin Framework, each Plugin is composed of the following information:

  • Type
  • Plugin name
  • Plugin version

Plugin Catalogs

Plugin Framework contains a concept called "Catalog". A single assembly can be a catalog. A .NET type can be a catalog. Folders with dlls are often used as catalogs and Plugin Framework also supports Nuget packages, Nuget feeds and Roslyn scripts as Plugin catalogs. Multiple catalogs are often combined into a single Composite catalog.

Each catalog contains 0-n plugins.

Plugin Framework provides the following officially supported catalogs:

Source code

Source code for Plugin Framework is available from GitHub.

Constributors

@panoukos41

Support

Commercial support for Plugin Framework is provided by Adafy.

Adafy Logo

Adafy is a Finnish software development house, focusing on Microsoft technologies.

License

Plugin Framework is available as an open source, MIT-licensed project.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].