Hi,
Is there any way to check if the application is in debug mode or running
from the exe.


Thanks in advance,
Debi

Re: How to check if application is in debug mode by Jared

Jared
Thu May 11 00:42:40 CDT 2006

My Favourite way ..

Application.StartupPath.IndexOf("bin") <> -1



Re: How to check if application is in debug mode by Patrice

Patrice
Thu May 11 03:14:06 CDT 2006

If you really want to test for DEBUG mode , you could use conditional
compilation (#If directive) to create a function that returns true /false
depending on the DEBUG symbol...
If you meant rather that you want to know if a debugger is attached, you
could use System.Diagnostics.Debugger.IsAttached...

--
Patrice

"Debi" <debi@nospam.com> a écrit dans le message de news:
83E2B1C6-24F5-4BD7-86B5-1C351857EB7F@microsoft.com...
> Hi,
> Is there any way to check if the application is in debug mode or running
> from the exe.
>
>
> Thanks in advance,
> Debi



Re: How to check if application is in debug mode by Herfried

Herfried
Thu May 11 03:46:50 CDT 2006

"Debi" <debi@nospam.com> schrieb:
> Is there any way to check if the application is in debug mode or running
> from the exe.

<URL:http://groups.google.de/group/microsoft.public.dotnet.framework.windowsforms/msg/f487c55d37f31274>

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


Re: How to check if application is in debug mode by Stoitcho

Stoitcho
Thu May 11 09:01:41 CDT 2006

Debi,

It depends what your understanding of debug mode is.
If you want to discover if the code is compiled with debug information I
think using conditional compilation and checiking for the DEBUG symbol is
the way to find out whether the exectuable is started from VS you can't do
that in all the cases, you can find out wehether the program was started
with debigger attached though. Check System.Diagnostics.Debugger.IsAttached
and if it returns true this means someone is debugging the application. It
could be VS or any other debbuger.


--
HTH
Stoitcho Goutsev (100)
"Debi" <debi@nospam.com> wrote in message
news:83E2B1C6-24F5-4BD7-86B5-1C351857EB7F@microsoft.com...
> Hi,
> Is there any way to check if the application is in debug mode or running
> from the exe.
>
>
> Thanks in advance,
> Debi



Re: How to check if application is in debug mode by debi

debi
Thu May 11 10:28:02 CDT 2006

Thanks for all the replies. System.Diagnostics.Debugger.IsAttached should
suit my purpose. I want to check if someone is debugging the application.

"Patrice" wrote:

> If you really want to test for DEBUG mode , you could use conditional
> compilation (#If directive) to create a function that returns true /false
> depending on the DEBUG symbol...
> If you meant rather that you want to know if a debugger is attached, you
> could use System.Diagnostics.Debugger.IsAttached...
>
> --
> Patrice
>
> "Debi" <debi@nospam.com> a écrit dans le message de news:
> 83E2B1C6-24F5-4BD7-86B5-1C351857EB7F@microsoft.com...
> > Hi,
> > Is there any way to check if the application is in debug mode or running
> > from the exe.
> >
> >
> > Thanks in advance,
> > Debi
>
>
>