I'm generating interop assemblies using TlbImp
. Several of my type libraries reference a single core type library.
When I run TlbImp
against First.dll
I get Interop.First.dll
and Interop.Core.dll
. The problem is that when I run it again, against Second.dll
, TlbImp
tries to generate Interop.Core.dll
again, resulting in the error:
TlbImp : error TI0000 : System.ApplicationException - The assembly for referenced
type library, 'Core', will not be imported since it would overwrite existing file
'Core.dll'.
How can I tell TlbImp
not to generate interops for referenced assemblies?
I needed to use the
/reference
parameter to explicitly identify existing interop assemblies.Originally I was running these commands:
TlbImp
would try to import the referencedCore.dll
and create an interop atCore.dll
in the second and third commands, triggering an error.To fix this, I just needed to explicitly specify the
Core
interop: