tlbimp issue - errors msg not helpful - System.TypeLoadException - Missing definition... RRS feed

  • Question

  • TlbImp : error TI0000 : System.SystemException - The type library importer encountered an error during type verification
    . Try importing without class members. : System.TypeLoadException - Missing definition for required runtime implemented
    delegate method.

    I am importing a dll that uses a few dlls that in turn use all sorts of dlls and it's a mess that I have no access to change. Thus I face this mess every time I rerun tlbimp. Some dependency way down the labrynth changes that I am not referencing and yet it breaks my interop. Is there any way to limit the number of layers that tlbimp creawls through? This run of tlbimp spits out over a 1000 lines when it runs against this sillyness.

    Oh yes, and using the switch noclassmembers only generates a different TI0000 error...

    On top of that, the error messages all have the same error code TI0000, and do not actually include the name of the object that tlbimp got stuck on. Wouldn't it be fairly simple to include this info when you are sitting on the object you are processing? This tool has been being used by many developers who have the tough job of trying to do new .Net stuff and integrate old VB6. This is not going away anytime soon, though we wish it would! A little help would be so appreciated. Make tlbimp.exe a better tool!

    Thanks for any info!


    Wednesday, February 13, 2008 2:15 AM

All replies

  • Could you please tell me what version of .net framework you're talking about?

    Also, y
    ou can send a sample project and repro steps in details to may email address which can be found in my personal profile page.

    In your case, you can also  build your own interop Dll,
    though this is a tedious and error-prone process.. For more details, please visit this thread.

    Thursday, February 14, 2008 5:56 AM
  • Running .Net 2, but v 1 is also installed.

    Unfortunately, the dlls and dependencies that cause the inability to create an interop wrapper amount to about 120 MB and are a licensed install. Creating this wrapper is the entire problem, thus the project it is loaded into is not really helpful. I am stuck in the batch file running tlbimp and having it fail.

    Through many hours of searching the web for clues, I came to the same conclusion that building my own wrapper would be very tedious. I got out the previously successful wrapper dll and disassembled it to IL, and it was huge. That would be more work than taking the entrie dependency set apart and figuring out which object is not loading.

    So I have concluded that basically I have to get versions and dates of all of the files in the install and figure out which are mismatched. It is a huge pain. The real kicker is that all of the programs I run in this install run fine with no errors with this install, and I am the only one in this set of binaries creating .Net code, so the rest work fine in VB6.

    I was hoping that someone would know an undocumented switch that would tell me what object it was processing when it gets stuck. That would be so helpful. The verbose switch only gives you hindsight (what has successfully been imported).

    Thanks for the reply. Any clues / tools for figuring this out would be appreciated!

    Thursday, February 14, 2008 5:15 PM
  • Please try using /noclassmembers switch of TlbImp to prevents Tlbimp.exe from adding members to classes.

    Feel free to tell me if this does not help.

    Friday, February 15, 2008 5:38 AM
  • Yes tried using /noclassmembers which I would have thought would do the trick. But tlbimp seems to process the same objects and go just as deep as it did previously, and instead ends with a different error after successfully processing the same object on the line above.

    Basically no net change in the result. I can't get to the machine where the error message can be reproduced. It is something like "cannot load" or "Missing definition."

    Is there any way to get tlbimp to tell what it is processing so that I can investigate the correct object?

    Thanks for the replies!

    Friday, February 15, 2008 6:03 PM
  • This might be an issue with the TlbImp tool.


    Could you please send a sample project including the TLB file as well as detailed repro steps to my email address which can be found in my personal profile page?


    And I'd appreciate if you can send the memory dump of Tlbimp when you came across the exception:


    1. Download the Debugging Tools from Windows from and install. Assume that you install it to “C:\Debuggers”.
    2. Open a command line prompt. Close all unnecessary applications.
    3. Try to reproduce the problem.
    4. Before TlbImp crashes , execute the following command at the command line prompt:
    cscript C:\Debuggers\adplus.vbs -crash -FullOnFirst -pn tlbimp.exe –o C:\Dump
    Dump file will be generated at “C:\Dump” and it usually takes several hundred MB. Make sure that you have sufficient disk space.
    5. After it crashes, please go to the folder “C:\Dump”. There can be multiple .DMP files. If their size are huge, please add the first .DMP file sorted by the timestamp (e.g. the first .DMP file captured) to a zip and upload it to the workspace:

    Tuesday, February 19, 2008 9:16 AM
  • And before you upload the files, send me a mail to know the password of the workspace.

    Tuesday, February 19, 2008 9:21 AM
  • Hi Feng,

    Thanks for the kind offer to help - it is greatly appreciated. However, I believe you have the wrong idea about where the issue occurs. I am running tlbimp stand-alone from a batch file. Devenv is not running at the time. The exact line calling it is (file names changed):

    "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\tlbimp" "names withheld here\Object.dll" /outSurprisebjectInterop.dll /namespace:MyNamespace /verbose /keyfileSurprisebjectInterop.snk

    I have also tried adding the /noclassmembers option and it stopped on the same line.

    Since it looks like the dump command you are requesting seems to specify the devenv as the program to watch, I am figuring that you did not understand that this is only within tlbimp that I am having the problem.

    It may be possible that I could send you the application that this is failing on, but as I mentioned before it is a huge set of applications and COM objects that have been all interconnected and thus the only way to recreate the issue would be:

    1. Install this entire system
    2. Go through the licensing process
    3. install the updates to new objects that have been updated since the last setup was built.
    4. register the updates with regsvr32
    5. run tlbimp on the dll I am attempting to wrap.

    I do not think there is a bug in tlbimp, as this process has worked fine for several versions, I just regularly run into the issue of it not working and then have to ask folks to get me the latest files that were not included in their roll-ups of the binaries. I (or someone else) then run a diff on my list of objects vs the latest stuff in VSS. The release is supposed to be specific to a client and may not be the latest files, though, so we go through and try to get it all synched up. I realize thiz process is very messy and the company is working toward a less-muddy way of managing their objects.

    Once this has been done and we can figure out which object is not the right one, I can usually get the wrappers to be built. Unfortunately I have not been able to resolve it this time, and so I came here hoping for someone to give me a clue as to what object tlbimp is stuck on. That info would be so helpful as an output option in the tlbimp program. The hindsight of what has just been processed is nice, but not nearly as helpful as what is currently being processed (or an error message about an object including the name of the object).

    Hopefully I have explained the situation well enough. Feel free to ask any further questions regarding this.

    I am also willing to ask if we can distribute the binaries to you and get them temporarily licensed for the sake of testing, but I don't know if you really would want to do that. It would take time and a free PC, and some interaction on the phone to activate the binaries that are soft-locked.

    Thanks again for your time!


    Tuesday, February 19, 2008 6:11 PM
  • Sorry for the type error, that Adplus command can work for any running process. So you can change the name of devenv into tlbimp.

    Wednesday, February 20, 2008 6:47 AM