Can I use AnyCPU?
When I select AnyCPU as a platform, I get a warning or an error!
When the computer starts Visual Studio, if I have selected AnyCPU, the software will decide whether to use the 32bit or 64bit version of the DLL. Yes, AnyCPU might work, but if I run the built application on another machine, with different setup, it might not work.
(Dynamic loading of the DLL might work, please check this external link for more information: https://stackoverflow.com/questions/108971/using-side-by-side-assemblies-to-load-the-x64-or-x32-version-of-a-dll)
Safest setup?
If I select x86 (WIN32) built application, it will run on both WIN32 and WIN64 machines.
Do I need WIN64?
If your application needs it, CANlib will work perfectly, but only on WIN64 machines. However, today (2021), the majority of Windows PCs are win64.
Microsoft Visual C++ and canlibCLSNET Redistributable
When installing your app on another machine (might not have Visual Studio installed), please remember to redistribute (and install) the “Microsoft Visual C++ Redistributable for Visual Studio 2017”. You will need to copy the canlibCLSNET.dll (x86 and/or x64) with your project executable. These dlls are not installed as part of the driver (they are part of KVASER CANlib SDK).
Thanks for reading this! If you have any questions or comment regarding this paper, please send a mail to SUPPORT@KVASER.COM.