title: Can't create Type Library File with Visual Studio 2010 generated DLL, but can with command-line compiled
body: <p>I have a TestClass.cs file that contains an interface, and a class, much like this:</p>
  
  <pre><code>namespace CPierce.CSharpBridge
  {
      [System.Runtime.InteropServices.Guid("3D08DF02-EFBA-4A65-AD84-B08ADEADBEEF")]
      public interface ICSide
      {
          // interface definition omitted...
      }
      [System.Runtime.InteropServices.Guid("CBC04D81-398B-4B03-A3D1-C6D5DEADBEEF")]
      public partial class CSide : ICSide
      {
          // class definition omitted...
      }
  }
  </code></pre>
  
  <p>When I compile this at the command line, and run regasm on it:</p>
  
  <pre><code>csc /debug /t:library TestClass.cs 
  regasm TestClass.dll /tlb:TestClass.tlb
  </code></pre>
  
  <p>I get a nice, big .tlb file suitable for including in a C++ project elsewhere....</p>
  
  <pre><code> 10/27/2011  01:50 PM             3,616 TestClass.tlb
  </code></pre>
  
  <p>When I put TestClass.cs into a "Class Project" in Visual Studio, compile it, run regasm, the resulting .tlb is pathetic and nearly useless -- it has no interface, no method signatures, etc...</p>
  
  <pre><code>[Compiled TestClass.cs as part of Project "ClassProject" in Visual Studio]
  regasm ClassProject.dll /tlb:ClassProject.dll
  
  10/27/2011  01:58 PM             1,132 ClassProject.tlb
  </code></pre>
  
  <p><strong>This is the same C# code in both cases</strong>, one being compiled with Visual Studio one at the command line, giving me completely different results.  </p>
  
  <p>What gives?  </p>
  
  <p>--</p>
  
  <p>Update:  Hans suggests that the <code>[ComVisible(true)]</code> attribute missing is causing the problem.  Tried it, and it worked.  But that still doesn't answer the question, <em>why</em>?  Why do I get different results based on which compile method I use?</p>