How to find out that an application is started by a debugger (VisualStudio) C #

In my C # code, I would like to know if the application was launched by the debugger (in my case, VisualStudio). Does anyone know how to get this information?

TIA

+4
source share
1 answer

System.Diagnostics.Debugger.IsAttached

Note: The answer is not entirely correct. :)

+8
source

Source: https://habr.com/ru/post/1316391/


All Articles