Visual-Studio – How to gradually complete the entire code block?

I want to be able to skip certain parts of the code when setting breakpoints. For example, I have a code block that iterates 52 times to create a deck of cards. This is normal work, I would rather not have to press F11 to continue through the block. Do I “skip” this anyway so the debugger can proceed to the next method call?

The language and IDE are C# in VS 2008.

If it is an option, you can move the code into a function and apply the [DebuggerStepThrough] attribute to the function so that it is always skipped during debugging

Like this:

p>

using System.Diagnostics;

namespace MyNamespace
{
public class Utilities
{
[DebuggerStepThrough ]
public ThisIsAVeryLongMethod()
{
//
// Code
//
}
}
}

Now in your code, when you step through it, the debugger will not go to the method, just continue to the next line

ShortMethod1() ;
ThisIsAVeryLongMethod();
ShortMethod2();

I want to be able to skip certain parts of the code when setting breakpoints. For example, I have a code block that iterates 52 times to create a deck of cards. This is normal work, I would rather not have to press F11 to continue through the block. Do I "skip" this anyway so the debugger can proceed to the next method call?

The language and IDE are C# in VS 2008.

If it is an option, you can move the code Into a function and apply the [DebuggerStepThrough] attribute to the function so that it is always skipped during debugging

Like this:

 using System.Diagnostics;

namespace MyNamespace
{
public class Utilities
{
[DebuggerStepThrough]
public ThisIsAVeryLongMethod()
{
//
// Code
//
}
}
}

Now in your code, When you step through, the debugger will not go to that method, but just continue to the next line

ShortMethod1();
ThisIsAVeryLongMethod();
ShortMethod2();

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 1941 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.