If you are developing with the Leap Motion and get the exception: “The type initializer for ‘Leap.LeapPINVOKE’ threw an exception.”, than you
- … have not added all *.dll files from the “/LeapSDK/lib/[x86 or x64]/” directory to the debug folder of your C# project
- … have added the wrong .dll files. For Example: If you have copied all the x64 dll files, but Visual Studio compiles the project in the x86 architecture, you also get this exception.
The solution is to simply copy all these *.dll files to “…/<YourProject>/bin/Debug/” resp. to change the x64 dll files with the x86 dll files (or vice versa).