可插入的 ASP.NET MVC 框架查询
我正在尝试创建一个可插入的 ASP.NET MVC 框架。我广泛使用了 Prism(用于 silverlight 的 CAB),并且是一个超级粉丝,希望在我的可插拔 ASP.NET MVC 框架中实现以下项目
该框架将有一个主机来加载 Unity 容器和其他基础设施项目(例如日志记录 。
插件将是独立的MVC2应用程序。每个应用程序都会实现 IModule 接口,它将在 Unity 中初始化和注册控制器/视图(这可能吗!!!)类型?
此 IModule 还将注册每个插件的自定义路由并将其添加到主机路由集合。
当应用程序启动时,将从数据库/外部文件加载插件列表,并且将调用项目的 IModule,这将在 Unity 容器中加载上述项目。
每当发出任何请求时,控制器都会从 Unity 中加载,并且视图也会被加载(我是否可以在 Unity 中注册一个自定义视图引擎,它将指向物理路径,而不是将资源嵌入到 dll 中)
这可能吗?这个问题可能听起来有点愚蠢......:)
I am trying to create a pluggable ASP.NET MVC framework. I have extensively used Prism (CAB for silverlight) and am a huge fan and wish to implement the following items in my pluggable ASP.NET MVC framework
The framework will have a host to load the unity container and other infrastructure items like logging services and all.
Plugins will be independent MVC2 application. Every application will have IModule interface implemented which will initialize and register Controllers/VIEWS(Is this possible!!!) type in Unity?
This IModule will also register custom routes per plugin and add it to host Routes collection.
When the application will start, the plugins list will be loaded from the database/external file and IModule of the project will be called which will load the above mentioned items in Unity Container.
Whenever any request is made, the controller will be loaded from unity and the Views will be loaded (Is it possible that I register a custom view engine in unity which will point to physical path rather than embedding the resource in the dll)
Is this possible. The question may sound a bit stupid... :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这通常是可能的,尽管需要从头开始进行大量工作。幸运的是,Microsoft 的 Orchard 项目已经完成了您所要求的几乎所有操作,并且您可以下载 MVC 源代码来查看它是如何完成的。请参阅:http://orchard.codeplex.com/
This is generally possible, though a lot of work from scratch. Fortunately Microsoft's Orchard project already does pretty much everything you are asking, and you can download the MVC source code to see how it's done. See: http://orchard.codeplex.com/