title: Avoid loading external references when registering a .Net assembly
body: <p>We have a .Net DLL that is available via COM interop which acts as a wrapper for a 3rd party's .NET library.</p>
  
  <p>This 3rd party library isn't needed in the vast majority of situations, so isn't included in our setup, but our wrapper DLL is.</p>
  
  <p>The problem comes when we try and register our wrapper DLL (with <code>regasm</code>) which fails with:</p>
  
  <blockquote>
    <p>RegAsm : error RA0000 : Could not load file or assembly '3rdParty.Application.Library, Version=5.3.0.0, Culture=neutral, PublicKeyToken=0123456789abcdef' or one of its dependencies. The system cannot find the file specified.</p>
  </blockquote>
  
  <p>As our wrapper already reports meaningful errors when it can't load the 3rd party library, is there a way to make regasm NOT try and load it (like <code>/delayload</code>) so our application can load it and get the error at run time?</p>
  
  <p><a href="http://www.thegatesofdawn.ca/wordpress/posts/2009/07/17/delay-loading-assemblies-in-net/" rel="nofollow">This article</a> suggests that assemblies are already delay loaded, but that doesn't seem to apply when registering COM interop assemblies.</p>