Execute code only while debugging with Visual Studio
<p>Is it possible to run specific code only when I am debugging the program via the debugging tools of Visual Studio?</p>

<p>If I use <code>#if DEBUG</code> or <code>Conditional(“DEBUG”)</code> the code is still triggered when running the .exe in the /Debug directory. </p>