Is there a chance to determine in an C# application whether it is currently being debugged? The idea is to ignore e.g timeouts, or to provide additional information.
Just to make this clear, I am not talking about the conditional compiler flag DEBUG
. This allows me to decide how the code shall be compiled. It gives no information about whether it is run in a debugger or not.
I need to decide at runtime, not at compile time.
You can use the Debugger.IsAttached
flag to determine this.
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