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
/referenceparameter to explicitly identify existing interop assemblies.Originally I was running these commands:
TlbImpwould try to import the referencedCore.dlland create an interop atCore.dllin the second and third commands, triggering an error.To fix this, I just needed to explicitly specify the
Coreinterop: