Ege.AspNetCore.Mvc.PluginsManager 1.0.2

dotnet add package Ege.AspNetCore.Mvc.PluginsManager --version 1.0.2
NuGet\Install-Package Ege.AspNetCore.Mvc.PluginsManager -Version 1.0.2
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="Ege.AspNetCore.Mvc.PluginsManager" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Ege.AspNetCore.Mvc.PluginsManager --version 1.0.2
#r "nuget: Ege.AspNetCore.Mvc.PluginsManager, 1.0.2"
#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.
// Install Ege.AspNetCore.Mvc.PluginsManager as a Cake Addin
#addin nuget:?package=Ege.AspNetCore.Mvc.PluginsManager&version=1.0.2

// Install Ege.AspNetCore.Mvc.PluginsManager as a Cake Tool
#tool nuget:?package=Ege.AspNetCore.Mvc.PluginsManager&version=1.0.2

Asp.Net Core Mvc Plugins Manager

build status latest version latest version

That is an open-source plugin(modular) and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that application framework. Include a main project without referencing it using mvc structure in .dll projects as a plugin

Installation

.Net Core Mvc Plugins Manager is available on NuGet

dotnet add package Ege.AspNetCore.Mvc.PluginsManager

or

PM>Install-Package Ege.AspNetCore.Mvc.PluginsManager

Usage

Create Project as Sdk="Microsoft.NET.Sdk.Razor" or Sdk="Microsoft.NET.Sdk.Web" Choose build output path

Sample Plugin.Tax plugin project in Plugin.Tax.csproj :

<Project Sdk="Microsoft.NET.Sdk.Razor">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <AddRazorSupportForMvc>true</AddRazorSupportForMvc>
  </PropertyGroup>
    ...
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <OutputPath>..\..\Applications\Application.WebMvc\Plugins\Plugin.Tax</OutputPath>
    <OutDir>$(OutputPath)</OutDir>
  </PropertyGroup>
</Project>

Add plugin info as json file PluginInfo.json :

{
  "Name": "Plugin.Widget",
  "File": "Plugin.Widget.dll",
  "Description": "Plugin Widget"
}

set File key as assembly name

Add Setup.cs like Asp.net core project for plugin:

using Ege.AspNetCore.Mvc.PluginsManager;
...
   internal class PluginSetup :IPluginSetup 
   {
       //for sorting between plugins middleware
       public int Order => 10;

       //your plugin ConfigureServices method
       public void ConfigureServices(IServiceCollection services)
       {
           //TODO:
       }
       //your plugin Configure method
       public void Configure(IApplicationBuilder app, IHostEnvironment env)
       {
           //TODO:
       }
   }
...

Add .Net Core MVC Main Project and some general Configurations for plugins

on Application.WebMvc.csproj include plugins dll in main project

<Project Sdk="Microsoft.NET.Sdk.Web">
...
  <ItemGroup>
    <Folder Include="Plugins\" />
    <Content Remove="Plugins\**\Properties\*.json" />
    <Content Include="Plugins\**\*.dll">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
...
  <Target Name="CreatePluginFolder" AfterTargets="AfterPublish">
    <MakeDir Directories="$(PublishDir)Plugins" Condition="!Exists('$(PublishDir)Plugins')" />
  </Target>
...
</Project>

And configure Startup.cs to load plugins

using Ege.AspNetCore.Mvc.PluginsManager;
...

...
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllersWithViews();
            ...
            //your plugin root directory
            var pluginRootPath = Path.Combine(AppContext.BaseDirectory, "Plugins");
            //load plugins
            services.AddPlugins(pluginRootPath);
            ...
        }

        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            ...
            app.UsePluginsConfigure(env);
            ...
        }
...
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. 
.NET Core netcoreapp3.0 is compatible.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.2 588 12/22/2019
1.0.1 536 12/18/2019
1.0.0 620 12/15/2019

Plungin project should be Sdk="Microsoft.NET.Sdk.Razor" or Sdk="Microsoft.NET.Sdk.Web"