title: Getting a System.AccessViolationException only during debug
body: <p><strong>UPDATE</strong></p>
  
  <p>I've changed the question with my latest findings and simplified as much as possible.</p>
  
  <p>I have the following piece of code</p>
  
  <pre><code>public virtual int DefineAction(bool b, string s, Type1 t1, Type2 t2)
  {
      return 1;
  }
  
  public ProcessResult Process(bool b, string s, Type1 t1, Type2 t2)
  {
     int i = DefineAction(b, s, t1, t2);    
     // more code
  }
  </code></pre>
  
  <p>When I put a breakpoint on the Line var <code>int i= ...</code>
  and I try to step through it I get an <code>AccessVialoationExeption</code></p>
  
  <p><strong>UPDATE:</strong> If I remove <code>virtual</code> for the function <code>DefineAction</code> no Exeption is thrown.</p>
  
  <p><strong>UPDATE2:</strong> If I remove one parameter from<code>DefineAction</code> for example define it as <code>DefineAction(bool b, string s, Type1 t1)</code> no Exeption is thrown.
  It's freaking me out now :-(</p>
  
  <p>None of the Assemblies is marked as unsafe. There's nothing running in separate threads.</p>
  
  <p>If I run the program in Visual Studio in Debug mode without breakpoint, the Exeption is not throwing</p>
  
  <p>Any hints or ideas how what's going wrong here?</p>