title: How to use #IF DEBUG in VB.NET
body: <p>Is it possible to assign a value to a class variable from inside a <code>#IF DEBUG</code> conditional?</p>
  
  <p>I want to conditionally execute some code from inside my main form load if I am running in <code>DEBUG</code> mode. I thought I could do something like:</p>
  
  <pre><code>Public Class Form1
      public DEB as Integer
  
      #if DEBUG then
          DEB = 1
      #else
          DEB = 0
      #end if
  
      Private Sub Form1_Load(....)
          if DEB=1 Then
              &lt;do something&gt;
          else
              &lt;do something else&gt;
          end if
      ....
  </code></pre>
  
  <p>However, it seems like you can't assign a value to a variable. I'm obviously not understanding the scoping correctly. I can't seem to put the <code>#if DEBUG</code> inside the Load sub routine. How do I do this?</p>