If you want to know whether the application is currently being debugged you can use the following code;

Public Shared ReadOnly Property DebugMode() As Boolean
    Get
        Dim rtn As Boolean = False

#If DEBUG Then
         rtn = True
#End If
        Return rtn
    End Get
End Property

The part of code in the if statement will only be executed if the application is currently being debugged, therefore the return value will be left as false.

Check whether the application is currently being debugged
Tagged on:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.