Search code examples
c#visual-studiocomwindows-installervisual-studio-setup-proje

COM-registered DLL doesn't generate/register type library with MSI installer


I've written a DLL using C# in VS2017 that I'm attempting to make properly COM-registered using a VS Installer, but cannot get the installer to generate/register a *.tlb file (which, if I understand correctly, the installer should do).

I think I'm doing it at least partially correct as I can see registry references to the ProgId - I have the DLL set to be registered with vsdrpCOM, it has an explicitly implemented interface, public default constructor, etc. but haven't had success.

I've been able to do it with regasm.exe, but that won't be available on the target machines. As well, since there are multiple target machines I'd rather it happen automatically as part of installation.

Am I missing something in setting up the installer? Is there a different, easier way to do it?


Solution

  • This should help, it's old but still the way to do it:

    https://www.simple-talk.com/dotnet/visual-studio/build-and-deploy-a-net-com-assembly/

    and skip down to Deployment. Basically you need to create a TLB file, and add that to the install with vsdrxCOM registration.