natemcmaster / DotNetCorePlugins

.NET Core library for dynamically loading code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] .net 5 support and Showing Listing of plugins that are active

davidbuckleyni opened this issue · comments

commented

In my app I want to provide a plugin ui in the same way nop commerce does here https://admin-demo.nopcommerce.com/admin/

if you goto configuration and plugins in the admin demo you will see it shows a list of plugins and allows the user of the system to install disabled and unload a plugin is this style of functionality possible I no I prop need to manage the list myself but can the information be obtained from your plugin and also will .net 5 be supported.

You need to provide plugin metadata yourself.
I personally use a plugin.json file that contains a reference to the main entry DLL and some extra info like plugin name, author, version and description.

When loading plugins just parse that JSON file into a class that keeps a reference to your plugin and store your plugins in a list. This library doesn't cover these things.

This is how I do it:
https://github.com/Artemis-RGB/Artemis/blob/5552996242a097d254cf91ea46d53aff9d936c0f/src/Artemis.Core/Services/PluginManagementService.cs#L216

As for .NET 5, it already works fine here with the 3.1 Nuget package but perhaps targeting .NET 5 directly brings some benefits to the table.

EDIT: You can probably get some info from the assembly returned by PluginLoader as well but that's quite limited.

I'm closing this as it seems this request is outside the scope of what this library provides. I believe you should be able to implement this on your own, so I'm not sure what value is added by new API in this library (nor am I completely sure what API is being proposed here.)