A small debug skill in

Source: Internet
Author: User

# Line this is a preprocessing command in C #.

    Visual Studio 2008
  • Visual Studio 2005
  • Visual Studio 2012
# Line hidden command hides several consecutive lines from the debugger, so that when a developer passes the code one by one, all lines between the # line hidden and the next # line command (assuming it is not another # line hidden command) will be skipped.

# The line hidden command does not affect the file name or row number in the error report. That is, if an error occurs in the hidden block, the compiler reports the current file name and the wrong row number.

Example:

The following example shows how the debugger ignores hidden rows in the code.

When you set a breakpoint as shown in the example and press F11 to pass the code one by one, you will see that the debugger ignores hidden rows.

Note that the debugger ignores the breakpoint even if it is set on the hidden line.

Private void Header_Loaded (object sender, RoutedEventArgs e) {# line hidden GetTaskNum (UserId); StateCallback (); # line default}

For details, refer to: http://msdn.microsoft.com/zh-cn/library/34dk387t (v = vs.100). aspx

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.