如何在ASP.net/ASP.net MVC中开发基于可插拔/可安装模块的应用程序

时间:2021-05-21 03:36:46

I am desiging the architecture of an application which will have many sub applications in it. Those sub-applications will be a developed by us but on a later stage.

我正在设计一个应用程序的体系结构,其中包含许多子应用程序。这些子应用程序将由我们开发,但在稍后阶段。

I want to create those sub-applications as installable plugin / module which might have multiple pages (.aspx pages) which should be able to interact with the Main Core Application and consume its shared data also.

我想创建这些子应用程序作为可安装的插件/模块,它可能有多个页面(.aspx页面),它们应该能够与主要核心应用程序交互并消耗其共享数据。

I strictly need The Plugins/Modules to be installable by manipulating the configuration or adding a folder of files or a DLL.

我严格要求通过操作配置或添加文件或DLL文件夹来安装插件/模块。

My Application will be an ASP.net web application. If ASP.net MVC solves the purpose then I can also look up for that also.

我的应用程序将是一个ASP.net Web应用程序。如果ASP.net MVC解决了目的,那么我也可以查找它。

My Application will make use of URLs to Identify the Module to be loaded. Following are some Examples of some URLs which I wish to have my application.

我的应用程序将使用URL来识别要加载的模块。以下是我希望拥有应用程序的一些URL的一些示例。

e.g.

http://www.myCoreApp.com/Module1/

http://www.myCoreApp.com/crm/

www.myCoreApp.com will host my Core Application in which my Modules will be installed.

www.myCoreApp.com将托管我的Core应用程序,我的模块将在其中安装。

Module1, crm, accounting and xyz are installed modules on My Core App.

Module1,crm,accounting和xyz是My Core App上安装的模块。

2 个解决方案

#1


3  

You should take look at MEF (Managed Extensibility Framework). It makes no difference if your app is ASP.NET web forms or MVC, or even if is Winforms

您应该看一下MEF(Managed Extensibility Framework)。如果您的应用程序是ASP.NET Web窗体或MVC,或者即使是Winforms也没有区别

#2


0  

I would go for MVC.

我会去MVC。

One could auto-discover the modules --- probably by convention and by checking implementation of a certain initialization type like IModule.

可以通过约定和检查某些初始化类型(如IModule)的实现来自动发现模块。

Then you could register your Controllers within a DI container (like Windsor) so all the 'shared' components will be injected by the container.

然后,您可以在DI容器(如Windsor)中注册控制器,以便容器注入所有“共享”组件。

HTH

#1


3  

You should take look at MEF (Managed Extensibility Framework). It makes no difference if your app is ASP.NET web forms or MVC, or even if is Winforms

您应该看一下MEF(Managed Extensibility Framework)。如果您的应用程序是ASP.NET Web窗体或MVC,或者即使是Winforms也没有区别

#2


0  

I would go for MVC.

我会去MVC。

One could auto-discover the modules --- probably by convention and by checking implementation of a certain initialization type like IModule.

可以通过约定和检查某些初始化类型(如IModule)的实现来自动发现模块。

Then you could register your Controllers within a DI container (like Windsor) so all the 'shared' components will be injected by the container.

然后,您可以在DI容器(如Windsor)中注册控制器,以便容器注入所有“共享”组件。

HTH