vb.net Visual Studio 2013 - F10 / F11 停止升级?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20574510/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio 2013 - F10 / F11 stopped working on upgrade?
提问by John Bustos
I just upgraded my Visual Studio from 2012 to 2013 and haven't done anything else yet short of installing all the updates recommended.
我刚刚将我的 Visual Studio 从 2012 年升级到 2013 年,除了安装推荐的所有更新之外,还没有做任何其他事情。
For whatever reason, when I go into my solution and press F10or F11, it runs the entire program as if I had pressed F5... F8works the way F10used to, but I don't know why the keys I've always used now don't.
无论出于何种原因,当我进入我的解决方案并按下F10或 时F11,它会运行整个程序,就好像我按下了一样F5......F8以F10过去的方式工作,但我不知道为什么我现在一直使用的键不'吨。
I set up visual studio as a VB environment.
我将 Visual Studio 设置为 VB 环境。
How can I fix this?
我怎样才能解决这个问题?
Thanks!!!
谢谢!!!
Additional Info:
附加信息:
Just to add on as much information as I can, if I set a breakpoint in my code, then I can use F10/ F11to continue stepping through my code once the breakpoint is hit and execution is stopped as would be expected.
只是为了添加尽可能多的信息,如果我在我的代码中设置了一个断点,那么我可以使用F10/F11在断点被击中并按预期停止执行后继续单步执行我的代码。
EDIT 2013-12-31:
编辑 2013-12-31:
Based upon a comment made by Neolisk, it appears this is simply a change in default behavior in Visual Studio 2013... If anyone knows how to change this back to the way it was in 2012, that would be GREATLY appreciated, but at least I now know it's not an error / installation issue.
根据Neolisk的评论,这似乎只是 Visual Studio 2013 中默认行为的更改......如果有人知道如何将其改回 2012 年的方式,那将不胜感激,但至少我现在知道这不是错误/安装问题。
回答by valverij
If 2013 works the same as previous versions, then do the following:
如果 2013 的工作方式与以前的版本相同,则执行以下操作:
- Navigate to Tools > Import and Export Settings
- Choose "Import selected environment settings"
- On the next screen, choose to save your current setings if you want to.
- When you get to the point where you can import, just select "General Development Settings"
- 导航到工具 > 导入和导出设置
- 选择“导入选定的环境设置”
- 在下一个屏幕上,如果需要,选择保存当前设置。
- 当您到达可以导入的点时,只需选择“常规开发设置”
That should set everything back to what you're probably used to. Most people are set up using general settings and either don't realize it or just forget.
这应该将一切恢复到您可能习惯的状态。大多数人是使用常规设置进行设置的,要么没有意识到,要么只是忘记了。
EDIT: If your issue is that the program executes when you press F10or F11when you are notdebugging, then I think you might be out of luck. It's done that to me personally since VS 2008 (I'll frequently miss the F12key when I'm in a hurry), and, after some searching, I think it actually happens to everyone:
编辑:如果您的问题是程序在您按下F10或不调试F11时执行,那么我认为您可能不走运。自 VS 2008 以来,我个人就这样做了(当我匆忙时,我经常会错过钥匙),经过一番搜索,我认为它实际上发生在每个人身上:F12
My guess is that this is a side-effect of not being able to set contextual hot keys based on whether you are or are not debugging. Since F10and F11are tied to debug-execution-related operations, my guess is that Visual Studio realizes that it needs to be debugging to process them, and thus starts the program.
我的猜测是,这是无法根据您是否正在调试来设置上下文热键的副作用。由于F10和F11与调试执行相关的操作相关联,我的猜测是 Visual Studio 意识到它需要调试来处理它们,从而启动程序。
ANOTHER EDIT:Of course, it's also possible that you had the scheme set to something else entirely in VS2012. Check out all of Visual Studio's pre-defined hotkeys by environment here: http://msdn.microsoft.com/en-us/library/da5kh0wa(v=vs.120).aspx
另一个编辑:当然,您也可能在 VS2012 中将方案完全设置为其他内容。在此处按环境查看 Visual Studio 的所有预定义热键:http: //msdn.microsoft.com/en-us/library/da5kh0wa(v=vs.120) .aspx
If none of those have the mappings that you're used to for F8, F10, or F11, then it's possible that you or an add-on may have had few custom hotkeys defined.
如果这些都没有您习惯的用于F8、F10或的映射F11,那么您或附加组件可能定义了很少的自定义热键。
Worst-case scenario, you can simply redefine your shortcuts manually by key in the keyboard settings: Tools > Options > Environment > Keyboard
在最坏的情况下,您只需在键盘设置中手动重新定义快捷键:工具 > 选项 > 环境 > 键盘
回答by Amarnath Balasubramanian
Microsoft probably has a reason to not allow to step into a property by default.
Microsoft 可能有理由不允许默认情况下进入属性。
Properties are supposed to be mostly get and set and not contain a whole lot of implementation in it. But that may not be the case all the time.
属性应该主要是 get 和 set 并且不包含大量的实现。但情况可能并非一直如此。
If somebody is trying to step into a property that means this developer is suspecting something in that property that may be causing problems. So by default this behavior needs to be reversed and allow stepping into properties.
如果有人试图进入某个房产,则意味着该开发商怀疑该房产中的某些东西可能会导致问题。因此,默认情况下,需要反转此行为并允许进入属性。
For now this is how you can enable stepping into properties.
现在,这就是您可以启用步入属性的方法。
- Go to Tools > Options menu in Visual Studio.
- Goto Debugging > General menu item in left pane.
- In right view you will see and option Step over properties and operators (Managed only). Uncheck this option and then you are all set.
- 转到 Visual Studio 中的工具 > 选项菜单。
- 转到左侧窗格中的调试 > 常规菜单项。
- 在右侧视图中,您将看到和选项跳过属性和运算符(仅限托管)。取消选中此选项,然后就全部设置好了。


Enable step into properties in Visual Studio Debugger
If the above didn't work then follow this
如果上述方法不起作用,请按照此操作
In the Options.Keyboard page, please select "Debug.StepOver" from the command listbox, and then put focus to the "Press shortcut keys" textbox and press F10, click Assign button to re-assign shortcut, does it work?
在Options.Keyboard页面中,请从命令列表框中选择“Debug.StepOver”,然后将焦点放在“按快捷键”文本框并按F10,单击分配按钮重新分配快捷键,是否有效?
You can also try to run Visual Studio under safe mode, which will prevents all third-party VSPackages from loading when Visual Studio starts; if the issue disappear under safe mode, you may consider checking your installed add-ons or VSPackages.
也可以尝试在安全模式下运行Visual Studio,这会阻止所有第三方VSPackage在Visual Studio启动时加载;如果问题在安全模式下消失,您可以考虑检查您安装的附加组件或 VSPackages。
Second, to log all activity of Visual Studio to a log file for further troubleshooting, please use the /Log switch, and post the log file content here, so we can do more investigation on it.
其次,要将 Visual Studio 的所有活动记录到日志文件中以便进一步排除故障,请使用 /Log 开关,并将日志文件内容张贴在此处,以便我们对其进行更多调查。
If this feature works well before, and suddenly behave abnormally, it usually indicate that some files or configurations of Visual Studio installation is corrupted or missed, you can:
如果此功能之前运行良好,突然出现异常,通常表示 Visual Studio 安装的某些文件或配置已损坏或丢失,您可以:
Restores Visual Studio default settings by using "Devenv.exe /ResetSettings" command. Please backup your settings before restore to default settings.
Repair/reinstall Visual Studio;
使用“Devenv.exe /ResetSettings”命令恢复 Visual Studio 默认设置。请在恢复默认设置之前备份您的设置。
修复/重新安装 Visual Studio;
To repair Visual Studio In the Add or Remove Programs dialog box, select Visual Studio then click Change/Remove.
修复 Visual Studio 在“添加或删除程序”对话框中,选择 Visual Studio,然后单击“更改/删除”。
回答by Jason Hughes
It sounds like you are in VB settings and not C#. You should try changing your settings to one or the other and see if those debug options change. On my machine
听起来您使用的是 VB 设置而不是 C#。您应该尝试将设置更改为一种或另一种,并查看这些调试选项是否发生变化。在我的机器上
Tools - Import Export Settings - Reset All Settings - C# (If you want F10/F11) VB if you want F8/Shift-F8. It doesn't matter what your settings are you can still code in both languages, but if you are used to pressing F10to debug VB.NET code you've been using C# settings this whole time. Nothing new with Visual Studio in this regard. I am using VS2013 Ultimate, have been using Visual Studio since VS2003.
工具 - 导入导出设置 - 重置所有设置 - C#(如果需要F10/ F11)VB 如果需要F8/ Shift- F8。无论您的设置是什么,您仍然可以使用两种语言进行编码,但是如果您习惯于按下F10调试 VB.NET 代码,那么您一直在使用 C# 设置。在这方面,Visual Studio 没有什么新鲜事。我使用的是 VS2013 Ultimate,自 VS2003 以来一直在使用 Visual Studio。
The first image is VB.net, second is C# settings

第一张图是VB.net,第二张图是C#设置



回答by Neolisk
You can try some of these reset settings:
您可以尝试其中一些重置设置:


And different combinations thereof, i.e. ResetToBasic first. If does not help, try ResetToC#, then back to Basic. Then try General, back to Basic. See if you can hack your way through like this.
以及它们的不同组合,即首先是ResetToBasic。如果没有帮助,请尝试 ResetToC#,然后返回 Basic。然后尝试一般,回到基本。看看你能不能像这样破解。
EDIT:I tried my VS 2012, and compared to VS 2013. What you described is completely normal. VS 2012 used to step in Form_Load and similar on F10 and F11, VS 2013 no longer does it. So it seems like your VS 2013 is working as expected.
编辑:我尝试了我的 VS 2012,并与 VS 2013 进行了比较。你所描述的是完全正常的。VS 2012 曾经在 Form_Load 和 F10 和 F11 上类似,VS 2013 不再这样做。因此,您的 VS 2013 似乎按预期工作。
回答by Ursegor
An idea to test it in a short way:
以简短的方式测试它的想法:
Create a Hello World console app.
创建一个 Hello World 控制台应用程序。
1 Module Module1
2
3 Sub Main()
4 Console.WriteLine("Hello")
5 End Sub
6
7 End Module
Build first. Put the cursor in line 4 (before each step), commands should start Debug Mode if you are in Design Mode.
先建起来。将光标放在第 4 行(在每个步骤之前),如果您处于设计模式,则命令应该启动调试模式。
- F10(StepOver): Should break on line 3
- F11(StepInto): Should break on line 3
- CTRL+F10(RunToCursor): Should break on line 4
- F10(StepOver):应该在第 3 行中断
- F11(StepInto):应该在第 3 行中断
- CTRL+ F10(RunToCursor):应该在第 4 行中断
If it is working properly:Maybe the assembly which containing the entry point of your program had modified and wasn't been rebuilded, or there is somthing other problem with the point where the control expected to break.
如果它工作正常:也许包含程序入口点的程序集已经修改并且没有被重建,或者控制预期中断的点存在其他问题。
If it doesn't work as expectedon the sample, I think you should ask on MSDN FORUMor make a bug report.
如果它在示例上没有按预期工作,我认为您应该在MSDN FORUM上询问或提交错误报告。
I don't know why they might have intent to change this behavior. It is working for me in my 2013 Express Edition with C# recently.
我不知道为什么他们可能有意改变这种行为。它最近在我的 2013 Express Edition 中使用 C# 对我有用。
回答by Jamie Clayton
I found I had to run VS as Administrator to debug properly. I also do a clean solution prior to debugging, especially on x64 machines. If you put a manual debug breakpoint in the code and the IDE indicates it can't stop at that point, then it's possible that the debugger is out of sync with the source code.
我发现我必须以管理员身份运行 VS 才能正确调试。我还在调试之前做了一个干净的解决方案,尤其是在 x64 机器上。如果您在代码中放置了手动调试断点,并且 IDE 指示它无法在该点停止,则可能是调试器与源代码不同步。
回答by John and Camille Shaw
I found what I think is an acceptable workaround for the non-functioning F10/F11 Keys. They are probably the most used keys in stepping through code, and it is a real pain to click on debug and select the key from the dropdown.
我发现我认为对于不起作用的 F10/F11 键是可以接受的解决方法。它们可能是单步调试代码中最常用的键,单击调试并从下拉列表中选择键真的很痛苦。
I got around this shortcoming by adding icons to the toolbar for these operations.
我通过将图标添加到这些操作的工具栏来解决这个缺点。
If you are not sure how to do this, On the Debug toolbar click on the down pointing arrow near the right side of the bar. Click on Add or remove buttons. Select Customize... Select Add Command Select Debug Scroll down to the desired key (Step over / Step into) You once clicked, you will see the two icons added at the left side of the toolbar, Unfortunately they are the same Icon, but with a little use, you should be able to select the right key to click on.
如果您不确定如何执行此操作,请在“调试”工具栏上单击栏右侧附近的向下箭头。单击添加或删除按钮。选择自定义... 选择添加命令 选择调试 向下滚动到所需的键(Step over / Step into) 点击一次,您将看到在工具栏左侧添加了两个图标,不幸的是它们是相同的图标,但是稍加使用,您应该可以选择右键单击。
I actually prefer this method to trying to remember which function key to press.
我实际上更喜欢这种方法,而不是试图记住要按下哪个功能键。
回答by Raphael
F10 was not working when I tried to use it while debugging. A solution I found here at 'Kudvenkat JavaScript tutorial No 4 How to debug JavaScript in Visual Studio' solved my problem. The solution was that Internet Explorer should be the default browser. I was using Opera. I hope this helps.
当我在调试时尝试使用 F10 时,它不起作用。我在“Kudvenkat JavaScript 教程 No 4 How to debug JavaScript in Visual Studio”中找到的解决方案解决了我的问题。解决方案是 Internet Explorer 应该是默认浏览器。我用的是歌剧。我希望这有帮助。
回答by FARHAN KHAN
On many branded laptops, there is an extra button "Fn", Press "Fn" and "Esc" together. Functional keys will be enabled in visual studio.
在许多品牌笔记本电脑上,有一个额外的按钮“Fn”,同时按下“Fn”和“Esc”。功能键将在 Visual Studio 中启用。
回答by Aaron Havens
Sounds stupid to ask but what type of keyboard do you have? I know some keyboards have different modes that allow you to set different profiles for keys based upon the application. I use the feature with my Microsoft Natural keyboard. However I have had problems with the profile still being active when I switch into Visual Studio and then F10, etc doesn't work correctly.
听起来很愚蠢,但你有什么类型的键盘?我知道有些键盘有不同的模式,允许您根据应用程序为键设置不同的配置文件。我在 Microsoft Natural 键盘上使用该功能。但是,当我切换到 Visual Studio 时,配置文件仍然处于活动状态时遇到了问题,然后F10等无法正常工作。

