Hi,

I would like to write a line of code which will get used in several
debugging points, to look like this..

If app.Mode = IDE then Stop Else End

Or if Stopped ended an EXE mode that would be good.

Application.StartupPath?

Re: Determine running from IDE by Jim

Jim
Mon Feb 27 23:43:57 CST 2006

If DesignMode Then

Else

End If

"Jared" <jared@paradigmitz.net.au> wrote in message
news:%23gV$mXCPGHA.1088@tk2msftngp13.phx.gbl...
> Hi,
>
> I would like to write a line of code which will get used in several
> debugging points, to look like this..
>
> If app.Mode = IDE then Stop Else End
>
> Or if Stopped ended an EXE mode that would be good.
>
> Application.StartupPath?
>



Re: Determine running from IDE by Stoitcho

Stoitcho
Tue Feb 28 08:23:51 CST 2006

That can be discovered only for Component - classes that derive from
Component or classes that implement IComponent. In the latter case this
information can be obtained by the component site (ISite) if set.

Either way you are looking for the DesignMode porperty. This property is
implemented as protected property in the Component class which in turn uses
the DesignMode property of the ISite interface.

For the rest of the types I don't think you can make this discovery.


--
HTH
Stoitcho Goutsev (100)

"Jared" <jared@paradigmitz.net.au> wrote in message
news:%23gV$mXCPGHA.1088@tk2msftngp13.phx.gbl...
> Hi,
>
> I would like to write a line of code which will get used in several
> debugging points, to look like this..
>
> If app.Mode = IDE then Stop Else End
>
> Or if Stopped ended an EXE mode that would be good.
>
> Application.StartupPath?
>



Re: Determine running from IDE by Patrice

Patrice
Tue Feb 28 08:59:36 CST 2006

You could perhaps base this on the build mode (debug or release ?) or
depending on wether or not you have a debugger attached rather than just
"running from the IDE" ?

--
Patrice

"Jared" <jared@paradigmitz.net.au> a écrit dans le message de
news:%23gV$mXCPGHA.1088@tk2msftngp13.phx.gbl...
> Hi,
>
> I would like to write a line of code which will get used in several
> debugging points, to look like this..
>
> If app.Mode = IDE then Stop Else End
>
> Or if Stopped ended an EXE mode that would be good.
>
> Application.StartupPath?
>
>



Re: Determine running from IDE by Herfried

Herfried
Tue Feb 28 16:08:10 CST 2006

"Jared" <jared@paradigmitz.net.au> schrieb:
> I would like to write a line of code which will get used in several
> debugging points, to look like this..
>
> If app.Mode = IDE then Stop Else End

Maybe the following solutions fit your requirements:

\\\
#If DEBUG Then
Console.WriteLine("Debug mode.")
#Else
Console.WriteLine("Release mode.")
#End If
///

Make sure that the option "Configuration settings" -> "Build" "Define DEBUG
constant" in the project properties is checked.

- and/or -

You can check if a debugger is attached:
'System.Diagnostics.Debugger.IsAttached'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Re: Determine running from IDE by Jared

Jared
Tue Feb 28 17:25:28 CST 2006

Closest to a solution, but would like something that would work even if i
gave client a debug version.