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
<PackageReference Include="AUR.NETCore.Mvc.PluginsManager" Version="1.0.0" />
<PackageVersion Include="AUR.NETCore.Mvc.PluginsManager" Version="1.0.0" />
<PackageReference Include="AUR.NETCore.Mvc.PluginsManager" />
paket add AUR.NETCore.Mvc.PluginsManager --version 1.0.0
#r "nuget: AUR.NETCore.Mvc.PluginsManager, 1.0.0"
#:package AUR.NETCore.Mvc.PluginsManager@1.0.0
#addin nuget:?package=AUR.NETCore.Mvc.PluginsManager&version=1.0.0
#tool nuget:?package=AUR.NETCore.Mvc.PluginsManager&version=1.0.0
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 | Versions 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. |
-
.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