title: Why VS2010 Express throws unsafe Threading error but command line csc.exe does not?
body: <p>Been cogitating over this for a while. There are no Unsafe declarations in the code.</p>
  
  <p>It compiles perfectly from csc but not from the IDE. I got it working in the IDE by changing</p>
  
  <pre><code>this.listBox1.Items.Add("example msg. . . ");
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>listBox1.Invoke(new Action(() =&gt; listBox1.Items.Add("example msg . . . ")));
  </code></pre>
  
  <p>and it continues to work from the command line. The thread is started in a different function   </p>
  
  <pre><code>Thread thread = new Thread(new ThreadStart(FuncContainingAddToListBox));
          thread.Start();
  </code></pre>
  
  <p>I understand that there are differences in the compilers, and that more can be done with the command line version, but I'm failing to hone in on what in this case... Any thoughts appreciated!</p>