Welcome to RenEvo Sign in | Join | Help

Correction for Vertigo Software post about debugging

Recently I read the article by Chris Idzerda over at Vertigo software that described how to Detect Visual Studio Debugging.  While the method he used was a bit of a "hacky workaround", below is a more sound way to detect it using built in .Net libraries, rather than a string lookup on the running executable.

VB.Net Version

   1:          If System.Diagnostics.Debugger.IsAttached Then
   2:              ' do code here for debugging with visual studio
   3:   
   4:          End If
 

C# Version

   1:              if (System.Diagnostics.Debugger.IsAttached)
   2:              {
   3:                  // do code here for debugging with visual studio
   4:              }

I hope this helps clear up any confusion.

Published Tuesday, June 10, 2008 2:01 PM by Tom Anderson

Comments

# Dark Under Eye

Thursday, March 10, 2011 6:10 PM by Dark Under Eye

# slut roulette

.Net Articles : Correction for Vertigo Software post about debugging

Thursday, November 20, 2014 3:54 PM by slut roulette
Anonymous comments are disabled