> I'm having trouble importing a type library containing coclasses that
> implement a source interface defined in another type library, and it
> appears to be a bug in TlbImp.  For example, if I have type library A that
> defines a dispinterface IEvents and type library B imports this definition
> using importlib("A.tlb"), if type library B has a coclass that exposes
> IEvents as a [default,source] interface then TlbImp chokes on it:
>
> TlbImp error: System.TypeLoadException - Could not load type B.IEvents
> from assembly B, Version=....
>
> Both type libraries are registered and I'm able to run TlbImp on typelib A
> with no problems, and I generated a primary interop assembly for it and
> added it to the GAC before trying to import typelib B.  I also tried using
> the /reference: option when importing typelib B (referencing my primary
> interop assembly for typelib A) in hopes of getting TlbImp to resolve the
> externally-defined source interface, but it still chokes as above. It has
> no problem if typelib B has coclasses with ordinary (non-source)
> interfaces defined in typelib A, only with source interfaces, and it makes
> no difference whether they're defined as a "dispinterface" or an
> "interface".  Has anyone run into this problem?  Is there a workaround?
>
> Jay McClellan
>
>

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to