Create a setup package for SolidWorks addin

08 Sep

  1. Insert a setup project to the addin solution

2. Add the necessary files to the newly created project: I have created two folders in the application folder, and in the “Bin” folder, I added “the project output”, which includes the Addin DLL and all the dependent assemblies. While in the “grammars” folder, I added related grammar “GRXML” files.

3. Select the setup project, and then property window, configure the icon of the installed program. This icon will be shown in the Control Panel > Program and Features, when users install or unsintall the program. You can additionally configure the manufacture name, product name and many other details, this will affect the default installation folder.

4. Right-click the installation folder, and click the “property window”, edit the default location to a descired one.

5. In order for your setup project to automatically register the Add-in DLL on the target machine, you can manually type “regasm YouDll.dll /codebase”. To include this auto-registration feature:

  • Add the two files “AutoRegAsm.cs” and “AutoRegAsm.Designer.cs”;
  • Open the two files, change the namespace to be the same as the one for the Add-in DLL;
  • Add a reference of System.Configuration.Install to the add-in project;
  • Right-click the setup project -> view -> Custom actions, in the “install” and “commit” node, add the dll or the “project output” as the executable;
  • Recompile the solution.



Posted by on September 8, 2008 in CAD, Dotnet/C#


10 responses to “Create a setup package for SolidWorks addin

  1. DotNET74

    October 8, 2008 at 2:18 am


    Very great blog.

    I’m looking for install C# AddIn in VS 2008 but i didn’t find the Addin on my Solidworks discs.

    Have you a link for me, please.


  2. Clint Cambier

    March 27, 2009 at 10:38 pm

    Hey there, thanks alot for the information provided on the page. However there seems to be a slight problem, you refer to two classes being: AutoRegAsm.cs and AutoRegAsm.Designer.cs.
    I can’t seem to find these somewhere sadly, are these your own creations and if so could you provide a link from where we can download these?

    Kind regards
    Clint C.

  3. xinyustudio

    March 29, 2009 at 12:38 pm

    Hi, Clint.
    The files are downloaded from elsewhere, and you can goolge it to get them. Let me know if you failed to find them and I shall append it in my download links. Good luck.

  4. Clint Cambier

    April 20, 2009 at 7:36 pm

    I tried to google for those 2 files but the only result Google gave me was this webblog.
    Is it possible to upload the files please.

    Kind regards
    Clint C.

  5. xinyustudio

    April 21, 2009 at 10:33 am

    Clint, please go to to get it, hope this helps.

  6. Clint Cambier

    April 21, 2009 at 5:54 pm

    Hello there,

    First of all: Thanks!
    I allready downloaded the files and I’m now trying to get this working.

    best regards

  7. Clint Cambier

    April 30, 2009 at 5:12 pm


    I got it al sorted out and working! Thanks for all of that.

    Now I experienced another problem. If I uninstall the project the registerkey isn’t removed. So now, Solidworks gives me an annoying error message every time I start up.

    Do you have a solution for this?

    Best regards

  8. xinyustudio

    May 20, 2009 at 3:26 pm

    Please give more detailed information. I can not figure out what is left and how to deal with this.

  9. Steve Lynch

    January 17, 2011 at 11:30 pm

    Can you point me to the two files AutoRegAsm.cs and AutoRegAsm.Designer.cs. or post the code for these?
    The link above does not provide this.

    Thank you.

  10. xinyustudio

    January 18, 2011 at 9:28 am


    Leave me your email and I shall offer a copy.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: