|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Running from the IDE, or not?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 A decent hack at it is> from the IDE or via a stand alone exe? 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! Show quote "AMercer" <AMer***@discussions.microsoft.com> wrote in message news:A0CC6D94-6A48-48FB-A3F0-C9D46E5ECF6C@microsoft.com... >> 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. > For the sake of better understanding this stuff - where do you find such I remembered IsAttached from having read about it a year or two ago. I > information? My searches gave me nothing near this. 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. |
|||||||||||||||||||||||