Skip to content

[Bug] Can't resolve dependencies when using C++/CLI Assemblies #292

@electro-logic

Description

@electro-logic

When launching

dscom tlbexport my.dll --asmpath D:\mypath

I found an unhandled exception with Visual Visual Studio:

Exception thrown at 0x00007FFB7531831A in dscom.exe: Microsoft C++ exception: HRMsgException at memory location 0x00000000001C7380.

at the function LoadFromAssemblyPath(dllToLoad)

return LoadFromAssemblyPath(dllToLoad);

and the issue is that not all types are loaded.

By replacing LoadFromAssemblyPath() with

Assembly.LoadFile(dllToLoad)

the assembly and all dependencies are correctly loaded.

Additional details:

my.dll is defining a COM interface and a class derived from MyLib.MyClass that is a class in another assembly that actually implement the interface

    [ComVisible(true)]
    [InterfaceType(ComInterfaceType.InterfaceIsDual)]
    [Guid("AA3C9EF2-AAAA-424B-8A96-35910B102956")]
    public interface ISum
    {
        int Sum(int a, int b);
    }

    [ComVisible(true)]
    [ClassInterface(ClassInterfaceType.None)]
    [Guid("AAAB3576-AAAA-4652-A87A-3579DD85AF69")]
    public class ComSum : MyLib.MyClass, ISum
    {
        
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions