title: Start Visual Studio programmatically; C# equivalent of VB's CreateObject("VisualStudio.DTE.8.0")
body: <p>I can start a new hidden Visual Studio process from VBScript, and drive it programmatically, by doing this:</p>
  
  <pre><code>Set DTE = CreateObject("VisualStudio.DTE.8.0")
  DTE.DoStuff()
  </code></pre>
  
  <p>How do I do that in C#?  (<strong>Edit:</strong> using the correct types, not generic COM objects as used by that VBScript code.)</p>
  
  <p>I've tried this:</p>
  
  <pre><code>using EnvDTE;
  ...
  DTE dte = new DTE();
  </code></pre>
  
  <p>but I get "Retrieving the COM class factory for component with CLSID {3C9CFE1E-389F-4118-9FAD-365385190329} failed".</p>