Combining C # and C ++ projects works for x86 and x64, but not for ARM

I have two projects in my solution. One of them is a universal C # application, and the other is a C ++ project (obtained from here ) and redirected to Windows 8.1 (this was done by Visual Studio 15 when I imported the project). I referenced the C ++ project from my C # project and set Copy Local to true.

The code is perfect for all three platforms (x86, x64 and ARM). However, when deploying to an ARM device, there is an exception thrown in the line where I am trying to access the C ++ code. On x86 and x64, this is not a problem, and the code works fine. The exception is System.IO.FileNotFoundException and an example of the exception is given here in detail .

My understanding of this exception is that the generated .dll for some reason is not copied to the device? I got acquainted with the configuration settings, and everything seems to be configured correctly, as far as I can tell (screenshot is shown below). Another possibility is that a C ++ project has an internal dependency on another class, which I somehow need to identify and reference from somewhere. There is a line from stacktrace (included in the aforementioned pastebin link) that assumes that it occurs on the line System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD) .

C ++ code uses the components of Media Foundation WinRT and should work fine on ARM devices.

It seems that other questions about SO (like here ) have also addressed this, but only for one specific platform such as x86.

Is there any special reason why this currently works on x86 and x64, but not on ARM?

Screenshots:

enter image description here

enter image description here

+6
source share
1 answer

and redirected to Windows 8.1

This is your problem right there. If you are targeting a Windows 10 device, you need to create a new Runtime Windows component (Universal Windows):

Universal Windows (10) Windows C ++ Runtime Component

I assume that Windows 8.1 Winmd is not compatible with your device.

I downloaded the VideoRecorder tool and reproduced your problem. Then, if I create a new Winmd Universal Windows, add C ++ files to it, it works without problems on Raspberry Pi 2 with Windows IO I.

EDIT: If you target a device running Windows 8.1 rather than a Windows 10 device, you need the Universal Windows 8.1 project:

Generic component of Windows Runtime Windows 8.1 C ++

I made a sample and deployed it to the Nokia Lumia 925 without any problems.

+3
source

All Articles