Exception when running nuitrack_csharp_example: SEHException

Hello,

I am trying to run nuitrack_csharp_example for the first time. I am using the RealSense D435 camera with Windows 10, Visual Studio 2017 x64. I have activated my Nuitrack license, followed the README file and this thread to complete my setup thus far.

The project builds in Visual Studio and I copied the nuitrack_csharp_example .exe to the parent folder as seen in the following screenshots:


When I run the nuitrack_csharp_example.exe from the nuitrack_csharp_example folder with my Intel camera plugged in and ready to go, this is the exception I am receiving:

SETUP - COM already setup - threaded VI might not be possible
Create DepthProvider: Realsense2DepthProvider

Unhandled Exception: System.Runtime.InteropServices.SEHException: External component has thrown an exception.
   at nuitrack.NativeImporter.nuitrack_CreateUserTracker(IntPtr& ptr)
   at nuitrack.NativeUserTracker..ctor()
   at nuitrack.UserTracker.Create()
   at nuitrack.MainForm..ctor()
   at nuitrack.Program.Main()

The program exits shortly after that.

I hope you will be able to help me with this issue, and I am happy to provide any further information required.

Could you provide the information about architecture [x32/x64] of your:
– Windows OS;
– Nuitrack;
– CMake Generator;
– build configuration for nuitrack_csharp_sample?

We noticed that you use different architectures for CMake generator and for build configuration in Visual Studio:
– in CMake, you use a x32 bit generator (Visual Studio 15 2017);
– in Visual Studio, you build project with Debug x64 configuration.

Hi Iosif,

Thanks for getting back to me. I am using a 64bit Windows 10 machine, with a Nuitrack x64 installation. I deleted my build directory for nuitrack_csharp_example, deleted the cache in CMake, configured and generated again using the Visual Studio 2017 x64 compiler as in the screenshot:

This is the output in CMake for the configuration above:
Selecting Windows SDK version 10.0.16299.0 to target Windows 10.0.18362.
The C compiler identification is MSVC 19.12.25835.0
The CXX compiler identification is MSVC 19.12.25835.0
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.12.25827/bin/Hostx86/x64/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.12.25827/bin/Hostx86/x64/cl.exe – works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.12.25827/bin/Hostx86/x64/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.12.25827/bin/Hostx86/x64/cl.exe – works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Found the following C# .NET versions: v4.0.30319; v3.5; v2.0.50727
Found CSharp: .NET
Using .NET compiler version v4.0.30319
Adding C# exe nuitrack_csharp_sample: ‘C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/csc.exe /d: /t:exe /out:nuitrack_csharp_sample.exe /platform:anycpu /reference:System.dll;/reference:System.Drawing.dll;/reference:System.Windows.Forms.dll;/reference:C:/Users/Emma/Documents/Vision/NuitrackSDK/nuitrack_csharp_sample/nuitrack.net.dll C:\Users\Emma\Documents\Vision\NuitrackSDK\nuitrack_csharp_sample\Program.cs’
Configuring done

I generated and built the project in Visual Studio 2017 using the x64 compiler. The build completed successfully.

I copied the .exe to the nuitrack_csharp_example. I executed the program and got the same exception as above unfortunately.

I believe I am aligned to 64bit entirely throughout my build. Is there anything else I should be checking? I would certainly be interested in purchasing the Nuitrack Pro Perpetual package should I get the trial version working to my needs.

Thanks again,
Emma

Could you try switching CMake to Advanced mode and changing CSHARP_PLATFORM from “anycpu” to “x64”?
If this does not help, then you need to provide the entire list of CMake parameters and try to build other samples, for example, nuitrack_console_sample or nuitrack_gl_sample

.