[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

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 ?
0
dvplayltd
Asked:
dvplayltd
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]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

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now