Last post Dec 05, 2016 03:21 PM by The Pax Bisonica
Nov 20, 2015 08:37 AM|ygoe|LINK
I'm developing an enterprise web application that is based on ASP.NET 5 and MVC6 for .NET Framework 4.6. It consists of service and desktop applications as well as a web server application. It already has a few shared assemblies for common data structures
and classes. And it already has a working plugin mechanism that allows me to load any plugin with a specific shared base class from a separate assembly into a host application.
The web application must be extensible through the same plugin system as well. So I'm looking for ideas how to build that. I have some experience with ASP.NET Web Forms and MVC from .NET 4.0 and I have read quite some articles about ASP.NET 5. So while I
know how to make controllers, views, routes and configuration in a single application, I have no idea how this can be extended with a plugin system.
Plugins should be able to provide full views with the corresponding controllers, accessible through their own URL route. The route should be provided by the plugin itself so that the host application just needs to load the plugin and know nothing about its
specifics. Multiple instances of a plugin can be loaded and they have their individual configuration so they could make unique routes on their own if necessary.
I think I need some form of Razor view pre-compilation to include it in a plugin assembly. I've seen such approaches for MVC 3 elsewhere but they don't seem to work anymore. Is that correct and how could I do that?
Then I think I need to tell the ASP.NET runtime about new routes, controllers and views after a plugin has been discovered and loaded. Route configuration is normally done in startup code only. Can it be altered later, too? And will the runtime find controller
types in assemblies that have been dynamically loaded after startup?
Are there any articles covering such topics?
Dec 02, 2015 08:22 PM|deepalgorithm|LINK
The following stackoverflow article seems relevant. Though its geared towards MVC 4 or 5.
Dec 05, 2016 03:21 PM|The Pax Bisonica|LINK
If you are looking for a plugin architecture based on Asp.net MVC then you should take a look at the Orchard CMS (http://www.orchardproject.net/). You build modules as separate Asp.Net projects and it handles
all of the routing from each project for you.