Running from the IDE, or not?

  • Thread starter Thread starter mikeb
  • Start date Start date
M

mikeb

I've tried about every search I can think of, but not finding the answer. I
found it before... somehow.

How, in code (VB particularly), can you test whether your app is running
from the IDE or via a stand alone exe?
 
How, in code (VB particularly), can you test whether your app is running
from the IDE or via a stand alone exe?

A decent hack at it is
Diagnostics.Debugger.IsAttached()
It is true if running from the IDE, and it is false if run standalone
without using some other debugger.
 
Perfect - that does it.

For the sake of better understanding this stuff - where do you find such
information? My searches gave me nothing near this.

Thanks!
 
For the sake of better understanding this stuff - where do you find such
information? My searches gave me nothing near this.

I remembered IsAttached from having read about it a year or two ago. I
found it the hard way, by browsing the .net class library documentation (it
comes with .net and it is available in MS's web site). No search helped me
on this question, but often searches are helpful.

In this case, your question and mindset was about 'am i running in the ide',
not 'am i running under a debugger'. If you had managed to phrase the
question in terms of a debugger, a search would probably have been
productive. That's not an easy thing to do, but it gets easier the more
reading you do. So, browse the documentation.
 
Back
Top