Is there an option/attribute/... that prevents VS's debugger from stopping a debugging session inside a specific method? I'm asking because I'm suffering from the BSoD that the class Ping of .NET 4.0 sometimes triggers. See Blue screen when using Ping for more details.
private async Task<PingReply> PerformPing()
{
// Do not stop debugging inside the using expression
using (var ping = new Ping()) {
return await ping.SendTaskAsync(IPAddress, PingTimeout);
}
}
DebuggerStepthrough
Fun fact you can set it at a method level or a class level.
Instructs the debugger to step through the code instead of stepping into the code. This class cannot be inherited.
Tested with
using System;
using System.Diagnostics;
public class Program
{
[DebuggerStepThrough()]
public static void Main()
{
try
{
throw new ApplicationException("test");
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
}
And the debugger didnt stop in the MAIN method
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With