title: "Current thread must be set to single thread apartment (STA)" error in copy string to clipboard
body: <p>I have tried code from <a href="https://stackoverflow.com/questions/3546016/how-to-copy-data-to-clipboard-in-c-sharp">How to copy data to clipboard in C#</a>:</p>
  
  <pre><code>Clipboard.SetText("Test!");
  </code></pre>
  
  <p>And 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 <code>Main</code> function has <code>STAThreadAttribute</code> marked on it.</p>
  </blockquote>
  
  <p>How can I fix it?</p>