We have a .Net DLL that is available via COM interop which acts as a wrapper for a 3rd party's .NET library.
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.
The problem comes when we try and register our wrapper DLL (with regasm) which fails with:
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.
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 /delayload) so our application can load it and get the error at run time?
This article suggests that assemblies are already delay loaded, but that doesn't seem to apply when registering COM interop assemblies.
ComRegisterFunctiondoesn't replace the whole "DllRegisterServer" equivalent but is rather called per type that needs registering, and will still hit the same assembly resolution problem. Writing direct to the registry may well be the only option. - Deanna