Distribution with Custom Applications
When you ship a custom application that uses the CAN Dragon SDK, deploy the native libraries alongside your executable and ensure the USB driver is installed on every target PC.
Target PC Setup
Before first use on a Windows deployment machine:
- Run the bundled CAN Dragon Drivers installer included with the SDK.
- Connect the CAN Dragon via USB-C and confirm the device appears in Device Manager without a warning icon.
- Copy your application and the SDK runtime files (see below) to the target folder.
::caution The driver installer requires administrator privileges on Windows. Plan for this in enterprise deployments or silent-install scenarios. ::
Files to Deploy
C applications
| File | Required | Notes |
|---|---|---|
Your application .exe | Yes | |
EmSACAN.dll | Yes | Match CPU architecture (x64 or x86) |
| EmSACAN.h | Build time only | Header for compilation; not required on target PC |
| Companion native libraries from SDK Release folder | Shared mode | Deploy the complete set of native libraries shipped beside EmSACAN.dll in the SDK Release folder |
Place all native DLLs in the same directory as your executable (or on the system PATH). Windows loads dependent DLLs from the application directory first.
C# applications
| File | Required | Notes |
|---|---|---|
Your application .exe | Yes | |
EmSACANNET.dll | Yes | Managed wrapper |
EmSACAN.dll | Yes | Native library loaded by P/Invoke |
| Companion native libraries from SDK Release folder | Shared mode | Same as C applications |
| .NET 6+ runtime | Yes | Ship framework-dependent or self-contained per your publish settings |
::note
Publish with dotnet publish -c Release -r win-x64 --self-contained false for a smaller footprint when the .NET runtime is already installed on the target PC. Use --self-contained true to bundle the runtime.
::
Exclusive vs Shared Mode Deployment
| Mode | Startup call | Deployment consideration |
|---|---|---|
| Shared (default) | EmSACAN_Startup(0) / Startup(false) | Deploy all companion native libraries from the SDK Release folder. Multiple applications can share the device. |
| Exclusive | EmSACAN_Startup(1) / Startup(true) | Deploy EmSACAN.dll (and ftd2xx64.dll or equivalent FTDI runtime if not installed globally). No companion service libraries required for exclusive direct USB access. |
Choose shared mode when users may run CAN Dragon View alongside your tool. Choose exclusive mode for dedicated single-application deployments.
Architecture Matching
Your application, EmSACAN.dll, EmSACANNET.dll, and all companion libraries must target the same platform:
- x64 — typical for modern Windows and Linux deployments
- x86 — legacy 32-bit Windows only
::caution Mixing x64 and x86 binaries produces load failures that are difficult to diagnose. Build and deploy a consistent platform configuration. ::
Suggested Folder Layout (Windows x64)
MyCanApp\
MyCanApp.exe
EmSACAN.dll
EmSACANNET.dll (C# only)
ftd2xx64.dll (if not installed globally)
... companion DLLs ... (shared mode only)
Verification Checklist
- CAN Dragon driver installer has been run on the target PC
- USB cable connected and device powered
- Application and all native DLLs are the same architecture (x64 or x86)
EmSACAN.dllis in the application directory- Shared-mode companion libraries copied from SDK Release folder (if using shared mode)
- Application calls Startup before Connect and Shutdown on exit ::
Updates
When you receive an updated SDK, replace EmSACAN.dll (and EmSACANNET.dll if applicable) in your deployment package. Re-test enumeration, connect, and CAN I/O after any SDK upgrade.
::note End users who only run CAN Dragon View still need the driver installer. Your custom application adds the SDK runtime files listed above. ::
