[英]Visual Studio Go to Definition (F12) opens Object Browser instead of Code View
I'm running VS2005, and when I right click on an object and select Go to Definition it brings me to the object browser instead of the actual code. 我正在运行VS2005,当我右键单击一个对象并选择Go to Definition时,它会将我带到对象浏览器而不是实际代码。
Is there some settings that I can change to fix this? 是否有一些设置可以更改以解决此问题? Note: it works properly for C# solutions, I am having the problem with Basic. 注意:它适用于C#解决方案,我遇到了Basic的问题。
This can also be caused by mismatched versions of the .Net framework in your advanced compile options. 这也可能是由高级编译选项中.Net框架的不匹配版本引起的。
I noticed that one of my projects was set as .net 3.5 and another was .net 4.0. 我注意到我的一个项目设置为.net 3.5,另一个是.net 4.0。
When I clicked Go To Definition (f12)
on the .net 4.0 project, the code in the .net 3.5 project would only be shown in the object browser. 当我在.net 4.0项目上单击Go To Definition (f12)
时,.net 3.5项目中的代码将仅显示在对象浏览器中。
Luckily I am able to change both to be the same without any issues, but those with established code libraries may need to beware when changing the .net version. 幸运的是,我能够将两者都改为相同而没有任何问题,但是那些具有已建立的代码库的人在更改.net版本时可能需要注意。
I usually see this when I have a reference to the library added as a "binary" reference rather than a "project" reference. 当我将库添加为“二进制”引用而不是“项目”引用时,我通常会看到这一点。 You might need to remove the reference and add it back from the projects tab. 您可能需要删除引用并将其从项目选项卡中添加回来。
I saw this too while using Visual Studio 2015, in (C/C++) native projects, after switching between different git branches. 我在使用Visual Studio 2015时,在(C / C ++)本机项目中,在不同的git分支之间切换后也看到了这一点。 The solution is to close VS, go in $(SolutionDir) and delete the .sdf file, then reopen the solution. 解决方案是关闭VS,进入$(SolutionDir)并删除.sdf文件,然后重新打开解决方案。
I'm not sure exactly why, but I had my Solution in Release mode when I was seeing this issue. 我不确定为什么,但是当我看到这个问题时,我的解决方案处于发布模式。 When I put the solution into Debug mode debugging/navigating worked properly. 当我将解决方案置于调试模式时,调试/导航工作正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.