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?
Jim Hughes - 28 Feb 2006 05:43 GMT
If DesignMode Then
Else
End If
> Hi,
>
[quoted text clipped - 6 lines]
>
> Application.StartupPath?
Stoitcho Goutsev (100) - 28 Feb 2006 14:23 GMT
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.

Signature
HTH
Stoitcho Goutsev (100)
> Hi,
>
[quoted text clipped - 6 lines]
>
> Application.StartupPath?
Patrice - 28 Feb 2006 14:59 GMT
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" ?

Signature
Patrice
> Hi,
>
[quoted text clipped - 6 lines]
>
> Application.StartupPath?
Herfried K. Wagner [MVP] - 28 Feb 2006 22:08 GMT
"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'.

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Jared - 28 Feb 2006 23:25 GMT
Closest to a solution, but would like something that would work even if i
gave client a debug version.