Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if the program is executed under Visual Studio control? [duplicate]

Is there any way of detecting that a debugger is running in memory?

and here comes the on Form Load pseudocode.

if debugger.IsRunning then
Application.exit
end if

Edit: The original title was "Detecting an in memory debugger"

like image 400
OrElse Avatar asked Aug 25 '09 19:08

OrElse


Video Answer


1 Answers

Try the following

if ( System.Diagnostics.Debugger.IsAttached ) {
  ...
}
like image 161
JaredPar Avatar answered Oct 14 '22 15:10

JaredPar