title: Register a signed .NET assembly in the "COM" world
body: <p>I trying to get a .NET DLL to be exposed as a COM class, too, and be accessible from non-.NET languages like VBA, C++ or Delphi.</p>
  
  <p>I created my C# DLL just fine, and I was able to register it on my test server as a COM component:</p>
  
  <blockquote>
    <p>C:\Windows\Microsoft.NET\Framework\v4.0.30319>regasm c:\inst\MyComComponent.dll /codebase<br>
    Microsoft (R) .NET Framework Assembly Registration Utility 4.0.30319.1<br>
    Copyright (C) Microsoft Corporation 1998-2004.  All rights reserved.</p>
    
    <p><strong>RegAsm : warning RA0000</strong> : Registering an unsigned assembly with /codebase can cause your assembly to interfere with other applications that may be installed on the same computer. The /codebase switch is intended to be used only with signed assemblies. Please give your assembly a strong name and re-register it.</p>
    
    <p>Types registered successfully</p>
  </blockquote>
  
  <p>OK, it worked - but it throws that ugly warning, so I went and created a <code>*.snk</code> file for my class library</p>
  
  <pre><code>sn -k MyComComponent.snk
  </code></pre>
  
  <p>and I added this <code>*.snk</code> file to my project properties (under "Signing"). It compiles fine, but when I transfer it to my test server and try to re-register it again, I get this:</p>
  
  <blockquote>
    <p>C:\Windows\Microsoft.NET\Framework\v4.0.30319>regasm c:\inst\MyComComponent.dll /codebase<br>
    Microsoft (R) .NET Framework Assembly Registration Utility 4.0.30319.1<br>
    Copyright (C) Microsoft Corporation 1998-2004.  All rights reserved.</p>
    
    <p><strong>RegAsm : error RA0000</strong> : Failed to load 'c:\inst\MyComComponent.dll' because it is not a valid .NET assembly</p>
  </blockquote>
  
  <p>I beg your pardon!?!?!? What happened here - and how to fix it??</p>