I'm developing an app in Unity 2020.3.3f1 to be deployed in HoloLens 2. This app has to deal with medical images thus I need to use SimpleITK library. I've downloaded SimpleITK source files and compiled them in Visual Studio 2017 for ARM64 architecture in order to match HoloLens 2 ARM64 architecture, following this procedure: https://blogs.windows.com/windowsdeveloper/2018/11/15/official-support-for-windows-10-on-arm-development/. I've added the native and managed .dll in Asset folder of the Unity project and I've written a c# script in which I use SimpleITK.
Everything works correctly in the Unity Editor without errors, but when I deploy the app in HoloLens 2 nothing works. Launching the debug of the solution in Visual Studio (Debug -> Start Debugging), these lines appear in the output window as soon as the script which uses SimpleITK is called:
'SpatialAwareness.exe' (Win32): Loaded 'U:\USERS\DefaultAccount\AppData\Local\DevelopmentFiles\BaseVS.Release_ARM64.Elena\SimpleITKCSharpNative.dll'. Module was built without symbols.
'SpatialAwareness.exe' (Win32): Unloaded 'U:\USERS\DefaultAccount\AppData\Local\DevelopmentFiles\BaseVS.Release_ARM64.Elena\SimpleITKCSharpNative.dll'
Exception thrown at 0x00007FFC1AAF39EC in SpatialAwareness.exe: Microsoft C++ exception: Il2CppExceptionWrapper at memory location 0x00000094365FE590.
How can the error be resolved?