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 ?
dvplayltdAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
you can do with this line:
if (Debugger.IsAttached = true) 

Open in new window

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
0
 
vbsquickresponseCommented:
check this...


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

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.