none
TlbExp ignore referenced assembly RRS feed

  • Question

  • Hello,
       
    I have the assembly (LibTwo.dll), which is the reference to another assembly (LibOne.dll).
    The content of the assembly LibOne.dll:
    using System.Runtime.InteropServices;
    
    namespace LibOne
    {
        [ComVisible(true)]
        [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
        [Guid("55288D71-30F0-4458-AC3E-304785ABCF9D")]
        public interface ILibOneSomeInterface
        {
            void DoSomeOne();
        }
    }
    The content of the assembly LibTwo.dll:
    using System;
    using System.Runtime.InteropServices;
    
    using LibOne;
    
    namespace LibTwo
    {
        [ComVisible(true)]
        [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
        [Guid("D8034B09-201C-4ca6-A1FC-F9DE64B2D539")]
        public interface ILibTwoSomeInterface
        {
            void DoSomeTwo();
        }
    
        [ComVisible(true)]
        [ClassInterface(ClassInterfaceType.None)]
        [Guid("7C352C7A-96A5-404c-A063-6588462E5F7C")]
        [Serializable]
        public class Class1 : ILibOneSomeInterface, ILibTwoSomeInterface
        {
            public void DoSomeOne()
            {
            }
    
            public void DoSomeTwo()
            {
            }
        }
    }
    I export assembly LibTwo.dll in the type library
    "$(DevEnvDir)\..\..\SDK\v2.0\Bin\TlbExp.exe" $(TargetFileName) /out:$(TargetName).tlb
    and get in the output two files LibOne.tlb and LibTwo.tlb. The type library LibTwo.tlb contains no directive import type library LibOne.tlb (importlib("LibOne.tlb")), only comment with guid of assembly LibOne.dll.
    The content of the type library LibTwo.tlb:
    // Generated .IDL file (by the OLE/COM Object Viewer)
    // 
    // typelib filename: <could not determine filename>
    
    [
      uuid(0DA8BED0-E327-4214-B90E-55E2181253F0),
      version(1.0),
      custom(90883F05-3D28-11D2-8F17-00A0C9A6186D, LibTwo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
    
    ]
    library LibTwo
    {
        // TLib :     // TLib :  <??filename}{D2A3EDB4-ABF8-4309-903E-2193E3611EDF}
        // TLib : mscorlib.dll : {BED7F4EA-1A96-11D2-8F08-00A0C9A6186D}
        importlib("mscorlib.tlb");
        // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
        importlib("stdole2.tlb");
    
        // Forward declare all types defined in this typelib
        interface ILibTwoSomeInterface;
    
        [
          odl,
          uuid(D8034B09-201C-4CA6-A1FC-F9DE64B2D539),
          version(1.0),
          oleautomation,
          custom(0F21F359-AB84-41E8-9A78-36D110E6D2F9, LibTwo.ILibTwoSomeInterface)    
    
        ]
        interface ILibTwoSomeInterface : IUnknown {
            HRESULT _stdcall DoSomeTwo();
        };
    
        [
          uuid(7C352C7A-96A5-404C-A063-6588462E5F7C),
          version(1.0),
          custom(0F21F359-AB84-41E8-9A78-36D110E6D2F9, LibTwo.Class1)
        ]
        coclass Class1 {
            interface _Object;
            [default] interface ILib1SomeInterface;
            interface ILibTwoSomeInterface;
        };
    };
    What am I doing wrong?
    Any help will be greatly appreciated.
    Thanks.
    Saturday, June 6, 2009 1:20 PM

Answers

  • If you don't want to upgrade then just download the Windows SDK.  It is free.

    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Friday, June 12, 2009 12:26 PM
    Saturday, June 6, 2009 4:41 PM
    Moderator

All replies

  • I cannot reproduce your problem with the provided code.  Running Tlbexp.exe on LibTwo.dll produces only one type library, this is its content:

    library LibTwo
    {
        // TLib :     // TLib : mscorlib.dll : {BED7F4EA-1A96-11D2-8F08-00A0C9A6186D}
        importlib("mscorlib.tlb");
        // TLib :  : {618F5704-E901-4F9F-8AC7-0428970870DD}
        importlib("LibOne.tlb");
        // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
        importlib("stdole2.tlb");
    ...etc...

    I used the Windows SDK v6.0a tools as installed by Visual Studio 2008.

    Hans Passant.
    Saturday, June 6, 2009 2:18 PM
    Moderator
  •    
    Sorry, forgot to indicate that the development environment - Visual Studio Professional 2005.
    Saturday, June 6, 2009 4:32 PM
  • If you don't want to upgrade then just download the Windows SDK.  It is free.

    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Friday, June 12, 2009 12:26 PM
    Saturday, June 6, 2009 4:41 PM
    Moderator