SOLIDWORKS add-ins in .NET Core/.NET6 and DLL versions conflict

Programming and macros
artem
Posts: 26
Joined: Thu Mar 18, 2021 1:31 pm
Answers: 3
x 9
x 74

SOLIDWORKS add-ins in .NET Core/.NET6 and DLL versions conflict

Unread post by artem »

Hi,

Currently one of the most common questions among the SOLIDWORKS API developers writing code in .NET (C# or VB.NET) is if add-ins should be ported/developed in .NET Core/NET6 or if it is still better to use .NET Framework.
In this video, I am explaining how to create SOLIDWORKS add-ins in .NET Core or .NET 6, how to resolve version compatibility, and what is the assembly strong naming why and when it should be used.



Thanks,
Artem
Thanks,
Artem
xarial.com - making your CAD better
codestack.net - SOLIDWORKS API macros and tutorials
Kjara
Posts: 21
Joined: Mon Jul 19, 2021 2:49 am
Answers: 0
x 1

Re: SOLIDWORKS add-ins in .NET Core/.NET6 and DLL versions conflict

Unread post by Kjara »

Regarding .net6:

If COM registration does not work, try adding the following property to the project file (i.e. into some <PropertyGroup>):

<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

Microsoft docs say about it:
The CopyLocalLockFileAssemblies property is useful for plugin projects that have dependencies on other libraries. If you set this property to true, any NuGet package dependencies are copied to the output directory. That means you can use the output of dotnet build to run your plugin on any machine.
Credit goes to Artem Taturevych for finding that out.
Post Reply