Link to home
Start Free TrialLog in
Avatar of dvplayltd
dvplayltdFlag for Bulgaria

asked on

I need IsIDE function in C#

Hi experts!

I created WinForm application with C# 2008. Will be very helpful to create boolean function IsIDE which tell me when Im starting the program within  IDE, and when I start program from .exe file. Can somebody help ?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
check this...


bool IsIDE = System.Diagnostics.Debugger.IsAttached;
 
if (IsIDE)
{
  MessageBox.Show("IDE");
}
else
{
  MessageBox.Show("EXE");
}

Open in new window