Your project.json doesn't list 'win10' as a targeted runtime

AnyCPU is no longer a valid configuration for managed (C#/VB) UWP apps. This is because all managed code (exe or dlls) for a UWP app is compiled using .NET Native toolchain to build architecture specific binaries. So if you are using a managed WinRT component in your HTML/JS UWP app, you will also need to set the specific architecture in your app project based on the device you are deploying to i.e. x86 for Desktop, ARM for Phone device.


I have a similar setup and the exact same problem. My current workaround is to set compiler to x86 when testing on the desktop, and changing to ARM when testing on mobile devices. Far from optimal, but if you figure out something better, I'd love to hear back.

According to this SO post, AnyCPU is not supported for UWP/C# apps.

In addition to making sure you test with .NET Native compilation, you may also notice that the AnyCPU build configuration has disappeared. With .NET Native brought into the mix, AnyCPU is no longer a valid build configuration because native compilation is architecture dependent. An additional consequence of this is that when you package your application, you should select all three architecture configurations (x86, x64 and ARM) to make sure your application is applicable to as many devices as possible.

Source: .NET Native – What it means for Universal Windows Platform (UWP) developers