Is Debug Runtime
Indicates whether the application is currently running under a debugger.
This is useful to detect whether the application is running in debug mode, such as during development or testing. It relies on the Diagnostics.Debugger.IsAttached property.
VB
Public Function IsDebugRuntime() As Boolean
Return Diagnostics.Debugger.IsAttached
End Function