SyntaxFix
Write A Post
Hire A Developer
Questions
You could try this if you only need the code to run when you have a debugger attached to the process.
if (Debugger.IsAttached) { // do some stuff here }