title: Issue with OpenFileDialog and threading
body: <p>I just upgraded from VS 2005 to VS 2012. This is a new issue that I do not understand. I am using the default "Form1" class the VS automatically creates. I added a button to open a file open dialog and when I click the button I get this error:</p>
  
  <blockquote>
    <p>Current thread must be set to single thread apartment (STA) mode before OLE calls can be >made. Ensure that your Main function has STAThreadAttribute marked on it. This exception >is only raised if a debugger is attached to the process.</p>
  </blockquote>
  
  <p>I have added " to Public Class Form1:</p>
  
  <pre><code>&lt;STAThread()&gt; Public Class Form1
  </code></pre>
  
  <p>But I get this...</p>
  
  <blockquote>
    <p>Attribute 'STAThreadAttribute' cannot be applied to 'Form1' because the attribute is not >valid on this declaration type.</p>
  </blockquote>
  
  <p>I have searched but get some info telling me that I need to set the entry point (Form1 I believe) to be Single Thread Attribute but the above code does not work.</p>
  
  <p>How?</p>