AUR.NETCore.Mvc.PluginsManager 1.0.0

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

NETCore.Mvc.PluginsManager

this library allows to have and manage plugins in the .netCore mvc projects. it is practical to manage the views both compiled in the * .views.dll file and as embedded resources. in addition it also allows you to manage additional controls that may be present in a plugin that adds functionality. in the future it is also necessary to manage the aggintic content that may be present in wwwroot.

use it is easy and comfortable look below for details

how to start

using AUR.NETCore.Mvc.PluginsManager;

Constructors

Base
PluginsManager PM = new PluginsManager<interfaces.IPluginBase>("absolutePath of plugin");
Example
const string PluginFolder = "Plugins";
static PluginsManager<interfaces.IPluginBase> _Plugins;
public static PluginsManager<interfaces.IPluginBase> Plugins { get { if (_Plugins == null) _Plugins = new PluginsManager<interfaces.IPluginBase>(Path.Combine(AppContext.BaseDirectory, PluginFolder)); return _Plugins; } }
Load
public void ConfigureServices(IServiceCollection services)
{
    //...
    services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
    Plugins.Load(services); // last row
}
Configure
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
   //....
    Plugins.Configure(app, env);    // before default route

    app.UseMvc(routes =>
    {
        routes.MapRoute(
            name: "default",
            template: "{controller=Home}/{action=Index}/{id?}");

    });
}

types of configuration

public enum ViewsTypeResouces
{
    Assembly,
    Embedded,
    None
}
public enum ControllerTypeResouces
{
    Assembly,
    None
}

here is an example of a plugin

using Microsoft.AspNetCore.Hosting;
using AUR.NETCore.Mvc.PluginsManager.interfaces;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;

namespace CompiledView_WithoutControllers
{
    internal class CompiledView_WithoutControllers : IPluginBase
    {
        public string Name { get => "CompiledView_WithoutControllers"; }
        public ViewsTypeResouces ViewsTypeResouces { get => ViewsTypeResouces.Assembly; }
        public ControllerTypeResouces ControllerTypeResouces { get => ControllerTypeResouces.None; }

        public void PluginConfigure(IApplicationBuilder app, IHostingEnvironment env)
        {
            //
        }

        public void PluginConfigureServices(IServiceCollection services)
        {
            //
        }
    }
}

here is an example of a costum plugin

common interface between project and plugin
public interface CostumPlugin : IPluginBase
{
    void Do();
    string version { get; }
}
main project inizialize
const string PluginFolder = "Plugins";
static PluginsManager<CostumPlugin> _Plugins;
public static PluginsManager<CostumPlugin> Plugins { get { if (_Plugins == null) _Plugins = new PluginsManager<CostumPlugin>(Path.Combine(AppContext.BaseDirectory, PluginFolder)); return _Plugins; } }
here is an example of a plugin
using Microsoft.AspNetCore.Hosting;
using AUR.NETCore.Mvc.PluginsManager.interfaces;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;

namespace CompiledView_WithoutControllers
{
    internal class CompiledView_WithoutControllers : CostumPlugin
    {
        public string Name { get => "CompiledView_WithoutControllers"; }
        public string version { get => "v0.1.23"; }
        public ViewsTypeResouces ViewsTypeResouces { get => ViewsTypeResouces.Assembly; }
        public ControllerTypeResouces ControllerTypeResouces { get => ControllerTypeResouces.None; }

        public void PluginConfigure(IApplicationBuilder app, IHostingEnvironment env)
        {
            //
        }

        public void PluginConfigureServices(IServiceCollection services)
        {
            //
        }
        public void Do()
        {
            // my do
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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 was computed.  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 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.1 is compatible.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 2.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 1,039 10/18/2018

first release, added all the basic features