Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plugin system with MVC3, Razor and C#

I'm fairly decent with MVC3 and enjoy creating my sites with it, however, I am yet to think up and implement a decent method of a "plugin" system.

Basically, I aim to have a generic "blog-type" CMS which I can distribute across my sites, but with the option to have certain things as plugins.

For example:

Generic build:

  • User area
  • Basic blog/news editing

Plugins: (May be needed for one or two sites, but not all)

  • Chatroom plugin
  • Stats
  • and so on...

Currently I would just make it all and disable things through a config file, however it would be nice if i could just drop a folder into my FTP and have an MVC page which automatically picks it up!

I assume I would have to start with scanning the directory "/plugins" and picking up a "plugin.config" (Or similar) file which would contain the basic details.

But how would I get my main system to pick these things up and actually use them?!

like image 555
JustAnotherDeveloper Avatar asked Nov 24 '11 10:11

JustAnotherDeveloper


People also ask

What is MVC3 application?

ASP.NET MVC 3 is a framework for building scalable, standards-based web applications using well-established design patterns and the power of ASP.NET and the . NET Framework. It installs side-by-side with ASP.NET MVC 2, so get started using it today! Download the installer here.

What are MVC plugins?

The ASP.NET MVC plugins is actually a extension based on another plugin framework OSGi.NET, technically, you can replace it with any other frameworks like MEF, Sharp-develop with some wrapping.

What are plugins in asp net?

The plugin framework is a NuGet package that allows you to customise and extend a . NET application at runtime. Code examples are provided for ASP.NET Core, Blazor, Console Apps and WPF & WinForms. The plugin framework package can be installed from NuGet and also supports the delivery of plugins from NuGet.

What is razor in Visual Studio?

What is Razor? Razor is a markup syntax that lets you embed server-based code (Visual Basic and C#) into web pages. Server-based code can create dynamic web content on the fly, while a web page is written to the browser.


1 Answers

You may be able to do this using MVC Areas, here are some links about them:

  • ASP.NET MVC 2 Areas
  • ASP.NET MVC Areas: Are they important to a large application?
  • https://stackoverflow.com/questions/462458/asp-net-mvc-areas-are-they-important-to-a-large-application
like image 134
Korich Avatar answered Sep 30 '22 16:09

Korich