问题描述
我有一个ASP.NET MVC 3的网站,我正在寻找一种方法来一组视图和控制器打包成一个外部DLL,希望使用MEF(依赖注入)来加载正确的控制器和视图。
I have an ASP.NET MVC 3 website and I'm looking for a way to package up a set of views and controllers into an external DLL and hopefully use MEF (Dependency Injection) to load the correct controllers and views.
有谁知道,如果这样的事情是可能的,任何好的教程的链接关于这个问题的?
Does anyone know if something like this is possible and any good links to tutorials on the subject?
推荐答案
的
这两个的组合可能会得到最好的结果在您的案件 - 我的precompilation code处理一些事情的单个文件生成器没有,但克里斯多使用开箱$ C $的c。在运行时,这可能是更好,如果你只需要在标准设置MVC3运行。
A combination of those two will probably get the best result in your case - My precompilation code handles some things the single file generator doesn't, but Chris has more use of out of box code at runtime, which is probably better if you only need to run in a standard mvc3 setup.
我也用设置为嵌入的资源ASPX文件(Views在ASP.NET MVC 单独的程序集),但剃刀是一个相当容易一点编译的形式进行工作。
I have also used aspx files set up as embedded resources ( Views in separate assemblies in ASP.NET MVC ), but Razor is quite a bit easier to work with in compiled form.
这篇关于我怎样才能让ASP.NET MVC 3使用的意见(ASPX,ASCX)文件从外部装配在我的网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!