c# - 有没有办法从 Visual Studio 2012 中的 MVC 4 项目中的 View 获取方法引用?

标签 c# asp.net-mvc visual-studio-2012

我想查看给定方法的所有引用。我的意思是 C# 源代码和 View (.aspx、.ascx、.cshtml)中的引用。有没有办法做到这一点? VS2012 设置还是插件?

最佳答案

如果您更改了一种方法并在 View 中使用它,但不知道是哪一个,您可以随时更改 MvcBuildViews .csproj 中的属性。

<MvcBuildViews>true</MvcBuildViews>

Resharper 是一款出色的工具,可让您查找解决方案中的所有用法(包括 View )。

http://www.jetbrains.com/resharper/

还有一些 resharper 的替代品:

CodeRush:http://www.devexpress.com/Home/Try.xml

JustCode: http://blogs.telerik.com/blogs/posts/09-11-18/code-just-code-justcode.aspx

VisualAssistX:http://www.wholetomato.com/

唯一免费的是 VSCommands:

http://visualstudiogallery.msdn.microsoft.com/d491911d-97f3-4cf6-87b0-6a2882120acf/ ,但我不确定它是否具有该功能。

这里还有一个客户反馈:http://aspnet.uservoice.com/forums/41201-asp-net-mvc/suggestions/3090767-make-find-all-references-search-in-mvc-views ,以防您想跟踪其状态。

关于c# - 有没有办法从 Visual Studio 2012 中的 MVC 4 项目中的 View 获取方法引用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13742314/

相关文章:

c# - 从需要身份验证的 Firebase 数据库加载数据会抛出错误 firebase 无法解析身份验证 token

c# - LINQ List<> 上下移动元素

visual-studio-2010 - 将现有文件夹添加到其他 Team Foundation Server 2012 已存在的 Team Foundation Server 2010

c# - filterContext.Cancel 发生了什么(ASP.NET MVC)

c# - 自定义授权属性不工作 asp.net

visual-studio-2012 - 在 Visual Studio 2012 中格式化 SQL 脚本

c# - 我可以使用wpf鼠标事件替换触摸事件吗?

c# - 在 getter 中声明变量

c# - 用于身份验证的自定义 url

c# - Oxyplot WPF 中的水平滚动条