0

I know this has probably been asked before, but I can't find the answer. Given a managed interop DLL that wraps a COM DLL, how do you use the Visual Studio command prompt to find the path to the COM DLL?

I've seen answers like this and this, but I'm not using the DLL in any VS project (yet); It's just sitting in my file system.

Does TLBIMP.EXE have a switch I can use, for example (I couldn't find one in the documentation)?

Community
  • 1
  • 1
rory.ap
  • 34,009
  • 10
  • 83
  • 174
  • Those links already have the answer. If you created the interop dll with tlbimp.exe then you already know with 90% confidence where the COM dll is located. Post the *exact* tlbimp.exe command you used. – Hans Passant Apr 01 '14 at 16:41
  • I created the interop DLL's months ago, and I have a few different copies of the COM DLL in a few different places. I'm trying to find out which copy the managed assembly points to. – rory.ap Apr 01 '14 at 16:43
  • It doesn't point to a "copy", it uses [Guid] to identify the component. Which is recorded in the registry as explained in those answers. If you have no idea where it came from then just delete it, creating another one is trivial. – Hans Passant Apr 01 '14 at 16:48
  • My question is not about how to get it to work; I know I can just delete it and create another one. The purpose of my question is so I can build my knowledge about using the VS command prompt and the VS interop utilities. And it does point to a "Copy" because I registered the COM dll from each of those folders, so they each have their own GUID. Regardless, that's not the point. – rory.ap Apr 01 '14 at 16:55
  • I'll guess you want to start with ildasm.exe first, shows the [Guid] attributes in the interop library. – Hans Passant Apr 01 '14 at 17:02
  • An interop-assembly does not [require any COM DLL at all to be present](http://stackoverflow.com/questions/21718553/finding-the-source-dll-name-from-interop-assembly-via-reflection/21796995#21796995). You should first check if you are able to create types from your interop assembly and then check the registration of those types like described on the link. – Carsten Apr 03 '14 at 11:54

0 Answers0