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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top