Link to home
Start Free TrialLog in
Avatar of willmrk
willmrk

asked on

Specific action only when debugger is running


how do I go about doing a specific thing or setting a variable when the debugger is running? I believe I may be able to use the DTE object in some way, but I havent been able to figure it out.

here's an example of how I would like to use it...

If doSomeFunctionToDetermineIfDebuggerRunning then debugMode = true

The reason I would like to know is because while we are debugging our code, I want to work with normal XML files (for ease of use). But when making a release, I want the XMLs to be encrypted.

Any help would be appreciated.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Brian Crowe
Brian Crowe
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
or, you can try this:

If System.Diagnostics.Debugger.IsAttached = True Then

 ' do what you want to do if it's in the debugging mode

End If

no need to check or uncheck any settings,

good luck,
yurich