locked
Debugging Windows Runtime component on Surface 2

    Question

  • Hi,

    I have created a blank VS 2013 C# Windows Store project with a C++ Windows Runtime Component. I can run this code without problems in the simulator and on a x86/x64 machine

    Now I want to test the application on a Surface 2 (RT) using the remote debugger. I can run pure C# (which use "Any CPU" architecture) apps using the remote debugger. But when I try to run the app with the C++ runtime component I get an error stating that x86 is not supported. So I went to the "Configuration manager" in VS2013 and selected the "ARM" Platform.

    But now the compilation of the Runtime Component fails completely with this error:

    1>------ Build started: Project: WindowsRuntimeComponent1, Configuration: Debug ARM ------
    1>TRACKER : error TRK0002: Failed to execute command: ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_arm\CL.exe" @C:\Users\developer\AppData\Local\Temp\tmpb2778db538a14a1c9a59d90997c32936.rsp". The requested operation requires elevation.
    1>  
    1>  
    2>------ Build started: Project: TestDelete, Configuration: Debug Any CPU ------
    2>CSC : error CS0006: Metadata file 'c:\users\developer\documents\visual studio 2013\Projects\TestDelete\ARM\Debug\WindowsRuntimeComponent1\WindowsRuntimeComponent1.winmd' could not be found
    ========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
    ========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========

    How can I test the app with the ARM architecture?

    Regards,

    Wednesday, March 26, 2014 10:59 AM

Answers

  • Look at the first error. The build process is unable to run the ARM C++ compiler, which results in the second error of the components winmd file not being available. Try running VS as Administrator and see if that helps. I've never encountered this problem when I compile for ARM. Perhaps there is a problem with your VS installation.
    • Marked as answer by SyFr Wednesday, March 26, 2014 3:03 PM
    Wednesday, March 26, 2014 2:50 PM

All replies

  • Both the RT Component and the app hosting it must be configured for ARM if running on RT device.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, March 26, 2014 12:27 PM
    Moderator
  • I have marked both, the C# XAML and the Runtime C++ component, as ARM. I am using VS2013 SP1 with the following steps:

    1.) Create a C# Windows Store project

    2.) Add a new C++ Store Windows Runtime component to the solution.

    3.) Add a reference to the runtime component to the C# project

    4.) Open Configuration manager, and select ARM.

    5.) Select remote device and press F5 to debug

    Then I get the message posted above.

    Wednesday, March 26, 2014 12:57 PM
  • Look at the first error. The build process is unable to run the ARM C++ compiler, which results in the second error of the components winmd file not being available. Try running VS as Administrator and see if that helps. I've never encountered this problem when I compile for ARM. Perhaps there is a problem with your VS installation.
    • Marked as answer by SyFr Wednesday, March 26, 2014 3:03 PM
    Wednesday, March 26, 2014 2:50 PM
  • Thanks for this hint! Running VS as admin works.
    Wednesday, March 26, 2014 3:03 PM