Is there a way to detect if a debugger is attached to another process from C#?

if(System.Diagnostics.Debugger.IsAttached)
{
    // ...
}

Leave a Comment