简体   繁体   English

Visual Studio转到定义(F12)打开对象浏览器而不是代码视图

[英]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框架的不匹配版本引起的。

http://blogs.msdn.com/blogfiles/bethmassi/WindowsLiveWriter/MigratinganOutlookClienttoVisualStudio20_CB9A/image_4.png

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.

相关问题 如何隐藏<summary>在 Visual Studio 代码中按 F12(转到定义)时的 [元数据]</summary> - How to hide <summary> in [metadata] when press F12 (Go to definition) in visual studio code 当按F12进入Visual Studio 2015 / C#中的定义时出现错误 - I got error when press F12 Go to definition in Visual Studio 2015 / C# (函数,全局变量)之间的Visual Studio 2019脚本标记(在cshtml中)转到定义(F12)不起作用 - Visual Studio 2019 script tags (in cshtml) between (function,global variable) go to definition (F12) doesn't work 如何通过单击F12在Visual Studio 2015中查看依赖项的源代码? - How to view source code of dependencies in Visual Studio 2015 by clicking F12? VSCode C#“转到定义”(F12)不起作用 - VSCode C# "go to definition" (F12) not working 如何使用F12在Visual Studio中查看C#代码详细信息? - How to see the c# code detail in visual studio using F12? 当使用不同装配中的步骤定义时,转到定义(F12)不起作用 - Go To Definition (F12) not working when step definitions are used from a different assembly Visual Studio Dom Explorer和IE F12工具Dom Explorer之间的区别 - Difference between Visual Studio Dom Explorer and I.E. F12 tools Dom Explorer 是否有任何附加组件/扩展可以让我在 Visual Studio 中 F12 存储过程? - Are there any add-ons/extensions that would let me F12 stored procedures in Visual Studio? 如果我只有 DLL 和 PDB 文件,有没有办法在按 F12 时浏览源代码? - Is there a way to browser Source Code when pressing F12 if I only have the DLL and PDB files?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM