C# – Why is this C# Class Library project unable to create a COM compatible DLL

c++class-librarycomdlltypelib

I've downloaded a C# Class Library called TreeViewAdv, that I need to use in another project as a COM DLL.

It builds successfully (Release, not Debug).

  • Registering the built DLL using "regasm" says "Types registered successfully"
  • Registering with "gacutil" says "Assembly successfully added to cache"

In the C# project settings:

  • Application > Assembly Information > Make assembly COM-Visible is checked
  • Build > Register for COM Interop is checked

When I attempt to add this built DLL to the VS via the "Choose Toolbox Items" dialog though, it says "Self-registration for XYZ.tlb failed."

Anything else I have to configure? Why can't I use this DLL in VS?

Best Solution

Not to forget this post that steps you thru registering the class.