Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know that the application is launched by debugger (VisualStudio) C#

In my c# code I'd like to know whether the app has been launched by the debugger (in my case VisualStudio). Does anyone know how to get this information?

TIA

like image 491
Olivier Avatar asked Feb 26 '23 15:02

Olivier


1 Answers

System.Diagnostics.Debugger.IsAttached

Note: The answer is not entirely correct. :)

like image 172
leppie Avatar answered May 10 '23 16:05

leppie