Debugging tips in VS

1. Sometimes you may need to tell debugger to break when some variable equals to a value as follows

if  (MyStringVariable  ==   " LKOH "
Debugger.Break();

Refer to System.Diagnostics namespace

http://msdn.microsoft.com/en-us/library/system.diagnostics.debugger.break.aspx

2. Remember VS debugger shortcuts helps:

Shortcut Description
Ctrl-Alt-V, A
Displays the Auto window to view the values of variables currently in the scope of the current line of execution within the current procedure
Ctrl-Alt-Break
Temporarily stops execution of all processes in a debugging session. Available only in run mode
Ctrl-Shift-F9
Clears all of the breakpoints in the project
Ctrl-Alt-Q
Displays the Quick Watch dialog with the current value of the selected expression. Available only in break mode. Use this command to check the current value of a variable, property, or other expression for which you have not defined a watch expression
Ctrl-Shift-F5
Terminates the current debugging session, rebuilds if necessary, and then starts a new debugging session. Available in break and run modes
F5
If not currently debugging, this runs the startup project or projects and attaches the debugger. If in break mode, this allows execution to continue (i.e., it returns to run mode).
Ctrl-F5
Runs the code without invoking the debugger. For console applications, this also arranges for the console window to stay open with a "Press any key to continue" prompt when the program finishes
F11
Executes code one statement at a time, tracing execution into function calls
Shift-F11
Executes the remaining lines of a function in which the current execution point lies
F10
Executes the next line of code but does not step into any function calls
Shift-F5
Available in break and run modes, this terminates the debugging session
F9
Sets or removes a breakpoint at the current line

转载于:https://www.cnblogs.com/feishunji/archive/2011/04/20/2022386.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值