SolidWorks API Add-In installer problem

I made a SolidWorks Add-In program in C# and try to make an installer for the Add-In. I use Microsoft Visual Studio 2022 community edition and tried both the Microsoft Installer and WIX. Everything goes fine and the Add-In is listed in the SolidWorks Add-In dialog box. However, if I check my Add-in in the Add-In dialog box, my Add-In is not loaded, and the checkbox is unchecked automatically. If I keep the original Add-In DLL that is generated by the Visual Studio in its output folder, SolidWorks finds that DLL and loads it instead. If I delete the original Add-In DLL (not the installed DLL), then SolidWorks won’t find and load the installed Add-In DLL (that is installed on C:\Program Files). I checked the Windows registry, and it looks like all information is correct in the registry. What am I missing?

Thank you
YS

This write-up that Artem put together helped me get things working with my add-in. Hopefully it help you too.

https://www.codestack.net/solidworks-api/deployment/installer/wix/

Thank you for your reply. That article is exactly what I followed, but the add-in is not loaded when it is installed on a new computer. It works fine in the development computer as the DLL is loaded from the DLL output from the Visual studio.

Good to see you found the article already. Are you using the “Approach A: Post build action” to register your project’s COM components? If so, is this inside your WIX tag as a to tell it to register these when installing?
image.png
The description of your problem sounds like it’s caused by an improperly registered DLL so I would begin looking at the DLL registration portion of the install. I ran into something similar and ended up generating all new GUIDs for my installer’s fields and everything worked.

At the risk of being Captain Obvious here; the two things that burn me over an over:

1: Project Properties → Build tab, Platform target: set it to 64 bit or at least >uncheck “Prefer 32-bit” CAD stuff has been all 64 bit for a couple years now, no need to compile for 32 that I know of.

2: Project References, Solidworks Library (or whatever software’s API you’re using) Embed Interop Types should usually be set to False.

Yes, those are included. I checked my Product.wxs with the one on the website line by line. There must be something missing or wrong but I cannot find it.

When running Solidworks, the Splash windows shows that the add-in is loading. The add-in is listed in the Add-In dialog box (Tools > Add-In). When I hover my mouse over the add-in item listed in the dialog box, however, the tool-tip pops up showing the Visual Studio output folder, not the installation folder. I don’t know how to let SolidWorks load the add-in DLL from the installed directory.

Thank you for your input. Yes, I set 64bit, and all are set to False.