Swx API for .netcore3.1 or .net5 or .net6
Posted: Mon Jan 31, 2022 3:06 am
We are thinking about switching our software development from .net framework to a newer .net version (core or 5.0 or 6.0) since framework is not going to be developed further (so it's going to be dead at some point).
Since we write quite a lot Swx addins and standalone projects (where Swx is remotely started and controlled), we must be sure that the Swx API works as expected. But it seems that the Swx API dlls are still not available for .net core, .net5 or .net6, only .net framework.
I know that there is an open-source library that allows writing Swx addins in .netcore3.1 (see https://xcad.xarial.com/), but it still uses the (only available) Swx API dlls targeted for .net framework. Has anyone used this with .netcore3.1 and can confidently say that it works well?
And what about .net5 and .net6?
It seems the xcad library does not yet support .net5 or .net6, but I checked the content of the xcad nugets and modified the targets file (in build folder) of xarial.xcad.solidworks.0.7.12.nupkg so that the registering command also includes net5 and net6. Then, as far as I can see, it works for .net5 as well (I used net5.0-windows as target framework); I was able to write a test addin just like here: https://forum.solidworks.com/thread/242319 that shows a message box at Swx startup. But it did not work for .net6 because the [ComRegisterFunction] and [ComUnregisterFunction] attributes don't seem to work; i.e. the functions marked with these attributes are not called.
Maybe @artem, the creator of xarial.xcad, could help?
Since we write quite a lot Swx addins and standalone projects (where Swx is remotely started and controlled), we must be sure that the Swx API works as expected. But it seems that the Swx API dlls are still not available for .net core, .net5 or .net6, only .net framework.
I know that there is an open-source library that allows writing Swx addins in .netcore3.1 (see https://xcad.xarial.com/), but it still uses the (only available) Swx API dlls targeted for .net framework. Has anyone used this with .netcore3.1 and can confidently say that it works well?
And what about .net5 and .net6?
It seems the xcad library does not yet support .net5 or .net6, but I checked the content of the xcad nugets and modified the targets file (in build folder) of xarial.xcad.solidworks.0.7.12.nupkg so that the registering command also includes net5 and net6. Then, as far as I can see, it works for .net5 as well (I used net5.0-windows as target framework); I was able to write a test addin just like here: https://forum.solidworks.com/thread/242319 that shows a message box at Swx startup. But it did not work for .net6 because the [ComRegisterFunction] and [ComUnregisterFunction] attributes don't seem to work; i.e. the functions marked with these attributes are not called.
Maybe @artem, the creator of xarial.xcad, could help?