我想查看给定方法的所有引用。我的意思是 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/