How to determine if running from IDE?

  • Thread starter Thread starter Dennis
  • Start date Start date
D

Dennis

Is there a way to programmatically determine if a vb.net app is running
from the IDE?
 
Is there a way to programmatically determine if a vb.net app is running
from the IDE?

Besides System.Diagnostics.Debugger.IsAttached, there is also a
precompiler constant / statement you can use. Since this is a
precompiler option, it can improve performance in the "live"
application (removes the actual if...then check for
Debugger.IsAttached). It also allows you to toggle code outside of
methods, such as switching variable values based on environment:

#If DEBUG Then
Private foo As String = "debug"
#Else
Private foo as String = "production"
#End If

Thanks,

Seth Rowe [MVP]
 
Back
Top