转到定义 &查找所有引用在 Visual Studio 中不起作用 [英] Go to definition & Find all references do not work in Visual Studio

查看:71
本文介绍了转到定义 &查找所有引用在 Visual Studio 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 VS 2013 Pro 中有一个 Windows 窗体解决方案,它在 VB 和 C# 中有几个项目.依赖项之一如下所示:

I have a Windows Forms solution in VS 2013 Pro that has several projects in both VB and C#. One of the dependencies looks like this:

Startup Project, SP (VB)
    Custom Controls Library, CL (C#)
       Utils/Constants Library, UL (VB)
    UL (again, referenced directly from SP)

我的问题是,当我从 SP 转到定义到 CL 时,它会将我带到对象浏览器.当我从 CL 转到定义到 UL 时,它会显示元数据.但是当我从 SP 转到 Def 到 UL 时,它工作正常.此外,当我在 CL 中查找控件的所有引用时,它不会显示 SP 引用,但是当我从 SP 中查找时,它会同时显示 SP 和 CL 中的引用.

My problem is that when I Go To Definition from SP to CL, it takes me to the Object Browser. When I Go To Def from CL to UL, it brings up metadata. But when I Go To Def from SP to UL, it works fine. Also, when I Find All References of a control in CL, it doesn't show the SP references, but when I do it from SP, it shows references in both SP and CL.

我在 StackOverflow、MSDN 和其他几个论坛上搜索过,并尝试了我找到的所有建议:我删除了所有引用并重建了它们(我 100.0% 确定它们都是项目引用,而不是文件引用).我已经完全删除了我的解决方案文件并从头开始添加了项目.我已确保参考文献中的 GUID 与参考文献的 GUID 匹配.它们都使用相同的框架构建,并且都用于相同的处理器类型.所有项目都在生成 pdb 和 xml 调试文件.我假设 VS2013 取消了 IntelliSense 数据库文件,因为我在磁盘上找不到任何要删除的文件(或者我会尝试删除!).

I have searched on StackOverflow, MSDN, and several other forums, and tried all suggestions I've found: I have removed all references and rebuilt them (I am 100.0% sure they are all project references, not file references). I have completely deleted my solution file and added the projects from scratch. I have ensured that the GUID in the references matches that of the references. They are all being built with the same framework, and all for the same processor type. All projects are producing pdb and xml debug files. I assume that VS2013 did away with IntelliSense database files, as I cannot find any of them on my disk to delete (or I would have tried it!).

另一个有趣的(我假设相关的)细节是 CL 中的方法/属性重命名没有反映在 SP 中.不仅 SP 子类的符号没有重命名,而且在我重建之前,Visual Studio 甚至不会提醒我这个错误.因此,似乎 IntelliSense 已损坏,或者我遗漏了其他东西.

Another interesting (I'm assuming related) detail is that method/property renames in CL are not reflected in SP. Not only are the SP subclasses' symbols not renamed, but Visual Studio doesn't even alert me to this error until I have rebuilt. So, it seems as if IntelliSense is corrupt, or there is something else I'm missing.

我真的很茫然.据我所知,此功能有效.我不能肯定地说它从 2012 年升级到 2013 年是否有效.有人有同样的经历吗?我禁用了附加组件、重建解决方案、重新添加项目依赖项……我会重新安装 Visual Studio,但如果有更简单的方法,我真的不想浪费几个小时的开发时间.

I am really at a loss. As far as I can remember, this functionality has worked. I can't say for sure whether it worked since upgrading from 2012 to 2013. Is anyone having the same experience? I have disabled add-ons, rebuilt solution, re-added project dependencies… and I would reinstall Visual Studio, but don't really want to lose several hours of development doing that if there is a simpler method.

推荐答案

最近升级到 VS2013 并且可以告诉您,当您单击定义它的函数名称时,查找所有引用"选项用于显示所有引用放置在调用函数的解决方案中.它现在所做的就是向您展示您正在查看的内容.

Have recently upgraded to VS2013 and can tell you that when you click on a function name where it is defined the "Find All References" option used to show all the places in the solution where the function was called. All it does now is show you the one you're already looking at.

现在我面前有第 218 行:公共共享函数 MyNewFunction(ByVal test As String)

In front of me now I have line 218: Public Shared Function MyNewFunction(ByVal test As String)

如果我右键单击 MyNewFunction 并选择Find All References",输出窗口会显示Find Symbol Results - 1 match found",它与上面的函数名称、文件和行号相同.所以它实际上是无用的.

If I right click on MyNewFunction and select "Find All References" the output window says "Find Symbol Results - 1 match found" and it's the same function name, file and line number as above. So it is effectively useless.

当然,除非有一些我们还没有看到的隐藏设置?

Unless of course, there is some hidden setting that we haven't seen yet?

这篇关于转到定义 &查找所有引用在 Visual Studio 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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