2

I am working on a multi-tenant MVC4 web portal that is meant to host dynamically generated MVC4 applications.

Use case: The client uses the web portal to upload a xml specification. The specification gets passed to a web service that generates an mvc4 application, compiles it and returns a zip file to the portal containing the views, css, javascript and a dll(compiled c# code). Then, the portal unzips the received zip file and places it's contents in a folder (Modules) inside the portal itself. Then the client can browse the newly 'deployed' application. Many versions of the same application can be deployed and I am planning to use different Namespaces for each deployment. Note: The generated modules have some dependencies that will be injected by the web portal using a DI injector (was thinking of using ninject)

I have done a lot of research on how to build a modular MVC application. I've looked at MVC Areas, done some research on MEF, DI frameworks, looked at nopCommerce and orchard code. One thing that I cannot seem to find an answer to is how to add the Modules at runtime without requiring an AppDomain restart? Also, is there an easy way to register routes for each of these modules at runtime?

I am trying to avoid app restarts because there may be other people using the portal/deployed modules while others are uploading new specifications.

4

1 回答 1

0

你看过这个(只是有点过时的)教程了吗?它不会解决重新扫描模块的问题,但是引入的PluginAreaBootstrapper类似乎是一个好的开始。也许您可以在系统中的特定事件上运行PluginAreaBootstrapper'Init()方法(我们称之为OnNewModuleDeployed)。

于 2013-08-01T09:42:39.913 回答