开发者

ASP.NET MVC Exclude Namespaces from New View Model Dropdown Menu

When you add a new 开发者_StackOverflow中文版view to an ASP.NET MVC project you can strongly type the view by selecting which model class it should work with in the dialog box. The problem is in that drop down menu it includes all the classes and interfaces from all referenced projects and dlls. So, I see all the Ninject classes, all the interfaces for my services, etc in that menu. Is there any way to specify which namespaces to include or a list of namespaces to exclude from that drop down menu?

I realize that this is not a big deal and you can just start typing the name of the class in the box and it will pull up the right one. I just thought that if there was a place for this it would be nice. If there isn't, no big deal but I thought I would ask. :)


If you really really want this and you are cool with some hacking, try this :)

c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Microsoft.VisualStudio.Web.Mvc.3.01.dll

decompile it - you will find MvcAddViewDialog class, and the GetTypes method in it. Put some filtering in it, recompile, replace, enjoy... but personally, I probably wouldnt :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜