pprnca
Last Updated: February 25, 2016
·
901
· ChrisMissal
3c4478e6ae6c60b73d21c9fa0d1785ea

Skip Extension Methods when Debugging

Your projects might have a few extension methods that aren't worth stepping through line by line. If you're navigating a call stack with F11, you might be unexpectedly taken away to another file containing extension methods that are there for convenience, not for logical reasons.

Consider the following (contrived) extension method:

[DebuggerStepThrough]
public static string Important(this string self)
{
    return self + "!";
}

With the added [DebuggerStepThrough] attribute, you will no longer navigate to that method when stepping through your code with F11.

For more details: http://msdn.microsoft.com/en-us/library/system.diagnostics.debuggerstepthroughattribute.aspx

Say Thanks
Respond