solidworks-api icon indicating copy to clipboard operation
solidworks-api copied to clipboard

Not able to register the Addin

Open Mussawer opened this issue 3 years ago • 6 comments

I am not able to register the dll because of Solidworks.interop.swpublished in the references of the project but as I remove the reference from the project I am able to register the dll but the addin is not loaded in solidworks neither able to debug it through visual studio

Mussawer avatar Dec 07 '20 13:12 Mussawer

Do you have the DLL property "Embed interop types" set to Yes/True by accident? It should be set to No.

brinkdinges avatar Dec 16 '20 10:12 brinkdinges

I have set it to "No" But I have begin my work using another approach Thanks for your help!!!!

Mussawer avatar Dec 19 '20 07:12 Mussawer

Hello, Have you fixed the issue of swpublished dll ? I also the all the solidworks.interop.xxxx dll embed interop type to false, it doesn't work either.

ConyKitty avatar Sep 22 '21 01:09 ConyKitty

There is no known problem with the DLLs and "it doesn't work" isn't enough for us to help you. Please share a small project that lets someone reproduce the issue and share the exact errors you're seeing.

I can think of three things that can go wrong:

  1. Embedding the DLLs is set to true/yes. You have checked for that.
  2. You have added DLLs to your own project that are not from SW2021. SolidDna references the SW2021 DLLs and you should too. See https://github.com/angelsix/solidworks-api/issues/118
  3. You have no GUID attribute added to your AddInIntegration class. I cannot find the issue where we talked about this.

brinkdinges avatar Sep 22 '21 09:09 brinkdinges

Hello, I have also the same problem with the solidworks.interop.swpublished.dll. I had installed SW2018 (now deinstalled) and now I want update to SW2021 (installed). So i have test the NuGet. I get this information from the registration:

RegAsm: warning RA0000: If you register an unsigned assembly with the / codebase option, the assembly may interfere with other applications installed on the computer. The / codebase option should only be used with signed assemblies. Give the assembly a strong name and reregister it. RegAsm: error RA0000: The file or assembly "SolidWorks.Interop.swpublished, Version = 28.1.0.74, Culture = neutral, PublicKeyToken = 89a97bdc5284e6d8" or a dependency on it was not found. The assembly manifest definition found does not match the assembly reference. (Exception from HRESULT: 0x80131040)

The used Version of SolidWorks.Interop.swpublished is 29.4.1.1! 28.1.0.74 is in SW2020. I also deleted it in the reference, this has no effect either.

Link to my test project according to the AngelSix video https://www.youtube.com/watch?v=r8e3xFlmZ_o https://github.com/elincooper/SW2021AngelSixNuGetTest

Is it possible, that SW2021 references are not yet implementet in the NuGet package?

If I replace the SW2021 references in the AngelSix.SolidDNA project and don't use the NuGet package, it works fine.

Thanks for your help.

elincooper avatar Sep 28 '21 08:09 elincooper

You are correct. The SW2021 DLLs are not yet in this NuGet package.

They are in my fork, where I also made some bug fixes that are lingering here as PRs. I also made some big changes, so I'll add some documentation first. https://github.com/CAD-Booster/solidworks-api

Thanks for the test project. I found out two things:

  1. You can get it to register by adding a reference to the SW2020 Published dll.
  2. You can get it running by also adding all other SW 2020 dlls.

brinkdinges avatar Sep 28 '21 11:09 brinkdinges