By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,317 Members | 1,329 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,317 IT Pros & Developers. It's quick & easy.

How to make a program know if it is running inside VS2005 IDE?

P: n/a
Hi all.

I am just wondering if there is a way to make a VB.Net program know
whether it is running from inside a Visual Studio 2005 IDE or a
compiled executable?

Thanks.
-CG

Jul 19 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
no****@nospam.com wrote in news:pg********************************@4ax.com:
Hi all.

I am just wondering if there is a way to make a VB.Net program know
whether it is running from inside a Visual Studio 2005 IDE or a
compiled executable?

You can use this command:

System.Diagnostics.Process.GetCurrentProcess().Pro cessName.ToLower =
"devenv"
Jul 19 '07 #2

P: n/a
On Thu, 19 Jul 2007 17:28:09 GMT, Spam Catcher
<sp**********@rogers.comwrote:
>You can use this command:

System.Diagnostics.Process.GetCurrentProcess().Pr ocessName.ToLower =
"devenv"

System.Diagnostics.Process.GetCurrentProcess().Pro cessName does the
trick.

Thanks very much.
-CG

Jul 19 '07 #3

P: n/a
no****@nospam.com wrote:
Hi all.

I am just wondering if there is a way to make a VB.Net program know
whether it is running from inside a Visual Studio 2005 IDE or a
compiled executable?

Thanks.
-CG
The one I use is -

System.Diagnostics.Debugger.IsAttached

The Debugger will only be Attached if running under the IDE.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Jul 19 '07 #4

P: n/a
On Fri, 20 Jul 2007 09:53:15 +1000, ShaneO <sp****@optusnet.com.au>
wrote:
>The one I use is -

System.Diagnostics.Debugger.IsAttached

The Debugger will only be Attached if running under the IDE.

ShaneO
That works too.
Thanks.

Jul 20 '07 #5

P: n/a
But surely that will only work in DEBUG mode & not RELEASE as it removes the
debugging info

|I am sure you can use a pre-processor to check this too. Something along the
lines of:

#If DEBUG Then
MessageBox.Show("Debug")
#Else
MessageBox.Show("Release")
#End If

--
Newbie Coder
(It's just a name)
<no****@nospam.comwrote in message
news:80********************************@4ax.com...
On Fri, 20 Jul 2007 09:53:15 +1000, ShaneO <sp****@optusnet.com.au>
wrote:
The one I use is -

System.Diagnostics.Debugger.IsAttached

The Debugger will only be Attached if running under the IDE.

ShaneO

That works too.
Thanks.

Jul 23 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.