ASP.NET MVC自定义视图路径打破了Visual Studio快捷方式 [英] ASP.NET MVC Custom View Path breaks Visual Studio shortcuts

查看:96
本文介绍了ASP.NET MVC自定义视图路径打破了Visual Studio快捷方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看了很多关于如何更改ASP.NET MVC项目的默认路径的文章,因此您可以通过扩展RazorViewEngine并指定新的路径格式来重定位或重命名Controllers,Models和Views文件夹.

I've seen a lot of articles on how to change the default paths for an ASP.NET MVC project so you can relocate or rename your Controllers, Models, and Views folders by extending the RazorViewEngine and specifying new path formats.

到目前为止,这很好用,但副作用是它破坏了Visual Studio的转到视图"或添加视图..."的快捷方式.

So far, this works great but the side-effect is that it has broken the Visual Studio shortcuts for "Go to View" or "Add View...".

关于是否可以自定义这些快捷方式选项以了解我指定的新路径的任何想法?

Any ideas on whether those shortcut options can be customized to know about the new paths I've specified?

提前谢谢! -斯科特

推荐答案

Visual Studio功能无法扩展为支持自定义路径.但是,在即将发布的ASP.NET和Web Frameworks 2012.2更新中(您可以立即从

The Visual Studio features cannot be extended to support custom paths. However, in the ASP.NET and Web Frameworks 2012.2 update that will soon be released (you can download a preview right now from here), the Add View functionality was updated to be a lot more flexible regarding which folders will have it enabled and which won't. It now supports Add View in any folder that is anywhere under a folder called "Views".

关于转到视图",该更新尚未更新,因为不幸的是,VS工具无法了解对视图引擎进行的运行时自定义-不过,我同意这会很酷!

Regarding Go To View, that was not updated because unfortunately there is no way for the VS tooling to be aware of runtime customizations made to the view engine - I agree it would be cool, though!

(顺便说一下,我的信息来源是我在Microsoft的ASP.NET MVC上工作.)

(BTW my source for this information is that I work on ASP.NET MVC at Microsoft.)

这篇关于ASP.NET MVC自定义视图路径打破了Visual Studio快捷方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆