Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Conditional execution based on app configuration

Reply
 
Old 03-28-2009   #1 (permalink)
John


 
 

Conditional execution based on app configuration

Hi

Is there a way to check within app if the app is running in debug
configuration (or that it is running in IDE instead of standalone) and then
decide what code to execute?

Thanks

Regards



My System SpecsSystem Spec
Old 03-28-2009   #2 (permalink)
AMercer


 
 

RE: Conditional execution based on app configuration

You can tell if your program has a debugger attached (any debugger, not just
the IDE) by:

System.Diagnostics.Debugger.IsAttached()

You can tell if using the debug configuration by including the following in
a module:

#If DEBUG Then
Public DebugBuild As Boolean = True
#Else
Public DebugBuild As Boolean = false
#End If

In your code, you can access the public variable DebugBuild.


"John" wrote:
Quote:

> Hi
>
> Is there a way to check within app if the app is running in debug
> configuration (or that it is running in IDE instead of standalone) and then
> decide what code to execute?
>
> Thanks
>
> Regards
>
>
>
My System SpecsSystem Spec
Old 03-28-2009   #3 (permalink)
Michel Posseth [MCP]


 
 

Re: Conditional execution based on app configuration

yes


condition

# IF DEBUG THEN

# END IF

or the isdebugger atched method to check if running in the IDE

Michel



"John" <info@xxxxxx> schreef in bericht
news:OdmgI45rJHA.4684@xxxxxx
Quote:

> Hi
>
> Is there a way to check within app if the app is running in debug
> configuration (or that it is running in IDE instead of standalone) and
> then decide what code to execute?
>
> Thanks
>
> Regards
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
conditional form action based on select value VB Script
Conditional execution of script for logged-on user VB Script
Conditional Formatting Vista General
If and Elseif Conditional Logic PowerShell
Re: using xp based drive as slave on new vista based computer?? Vista installation & setup


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46