C # reference: debuggerstepthrough feature saves debugging time

Source: Internet
Author: User

MSN remarks:

The Common Language Runtime Library does not add any semantics to this attribute. Provide itSource codeUse the debugger. For example, the Visual Studio 2005 debugger does not stop a method marked with this property, but does allow breakpoint setting in this method.

Detailed explanation:

When you are working on dubug, one annoying thing is that you have to enter someCodeMethod (or attribute. Suppose you have the following code:

 

Public StringWord
{
Get;
Set;
}

And you used this property when calling a method:
Dosomething (obj. Word );
When you debug this line of code, press F11 to enter the method. At this time, you will have to first enter the attribute, and then press F11 to enter the method.

If you want to remove the extra step, you can replace the above Code with the following style:

Code
Public StringWord

{

[System. Diagnostics. debuggerstepthrough]

Get{ReturnWord ;}

[System. Diagnostics. debuggerstepthrough]

Set{Word=Value ;}

}

In this way, when you debug to dosomething (obj. Word); this line of code, the debuggerstemthrough feature will tell the debugger to directly enter the method without entering the attribute content.

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.