Windows 10 development: how to debug a Windows Runtime component (written in C #) that is consumed by Javascript code

I am trying to develop a Windows 10 application as follows:

  • Application written using HTML5 / WinJS
  • The application uses the Windows Runtime component that I wrote in C #

I can hit a breakpoint in javascript that calls a method call in WRC. But I can’t enter the code and see what happens inside it. The reason for this is because the debugger is set to Script mode. If I set it to Native then it will never hit the javascript code.

My problem is that Visual Studio does not allow me (as far as I know) to attach the source code of an external link so that I can put a breakpoint in it and start the debugger in native mode. Resharper has this feature, but I need a solution in Visual Studio.

Visual Studio Let me attach the source code when I try to navigate to a link from native code. I confirmed this by writing a dummy Windows 10 application using C #, and then tried to take a step in invoking the same component of Windows Runtime. When the source was not available, he asked me about it, and I was able to connect it and execute the code.

Does anyone have any ideas?

+6
source share
1 answer

I had a similar problem. I have a C # Windows Runtime application that referenced the C ++ / CX Runtime component, and I could not get a breakpoint to get into the C ++ code. Fixed:

  • In a C # project: Go Properties
  • Choose Debug Tab
  • Debugger type : for the Application / Background process, select "Mixed (Managed and Native)"
+2
source

All Articles