Portable class library and Universal Windows App with Kinect v2

0

Using Visual Studio 2015, I need to create a Universal Windows App and I want to add a Portable Class Library in the same solution. In this Portable Class Library I want to add a reference to Microsoft.Kinect.dll . But when I execute the code in Local Machine, I get the following error:

Exception thrown: 'System.BadImageFormatException' in AppKinect.exe

Additional information: Could not load file or assembly 'Microsoft.Kinect, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)

Is it possible to solve this problem? Could I add a reference to this .dll in order to indirectly use Kinect v2 in Universal Windows app? As I read that for now Universal Windows app doesn't support using Kinect v2.

I also try to add a manual reference to Microsoft.Kinect.dll using

AssemblyName longName = new AssemblyName("Microsoft.Kinect.dll, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
Assembly assem = Assembly.Load(longName);

but I obtain the same error.

Thanks in advance!

c#
win-universal-app
kinect
portable-class-library
windows-10-universal
asked on Stack Overflow Mar 10, 2016 by user3506770 • edited Mar 10, 2016 by user3506770

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0