StopSwitch Stops Execution for Just-In-Time Debugging

Module

Private stopSwitch As New BooleanSwitch("Stop", "Stops execution to allow for Just-In-Time debugging.")

Procedure where you want to stop

Usually, the first statements in the assembly (application executable or dynamic-linked-library).

If stopSwitch.Enabled Then
    Stop
End If

App.Config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
   <system.diagnostics>
      <switches>
         <add name="Stop" value="1" />
      </switches>
   </system.diagnostics>
</configuration>
 

Debugger.Launch or Debugger.Break work just as well as the <code>Stop</code> statement.

About these ads
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s