Mixed Native and Managed Debugging Improvements for Windows Store Apps

Mixed Native and Managed Debugging Improvements for Windows Store Apps

Rate This
  • Comments 4

In Visual Studio 2012 RTM, there was limited support for mixed managed and native debugging of Windows Store apps.  This support was greatly enhanced in Update 1.

Setup

Enabling mixed mode debugging is simple.  All you need to do is select your project and choose “Properties” from the context menu.  Then click on the Debug properties tab.  Then on the debugger type, select “Mixed (Managed and Native)”. Then hit F5 as usual.

Here is what this looks like when configuring a managed project.

 

 

And here is what the project configuration looks like on a native application.

 

Inspection of Native WinRT objects

When stopped at a breakpoint, it was very difficult or impossible to view the object in the locals window, watch window, etc.  As you can see, there is not a lot of interesting information when you are looking at Button1 using the RTM release of VS2012.

 

 With the Update 1 release, the object inspection experience is exactly the same as it is when debugging only native code and you can now see the properties that you expect when you expand button1.

 

 Additionally, the new Debugger Type Visualizers for Visual Studio 2012 now also apply when mixed debugging a Windows Store app.

Remote Debugging

It is now possible to remote debug a Windows Store application using the mixed mode debugger when the target is an x86 or x64 machine.  This is accomplished by just using the standard procedures for running Windows Store apps on a remote machine.

This is not currently supported on ARM machines.

 

Reliability in Execution Control

One noticeable area of improvement was in stepping between WinRT components.  Let’s say that you were stopped here:

 

 

…and you wanted to step into your native component.  While before with the RTM release you would end up here:

 

…now with these improvements in Update 1, you will land where you would expect:

 

We would love to hear any questions or comments you have on the mixed debugging experience for Windows Store applications in the comments below or in our MSDN forum.

Leave a Comment
  • Please add 2 and 5 and type the answer here:
  • Post
  • What about debugging improvements for normal mixed apps? It was horribly broken before Update 2, and it seems to be better but I can't find any documentation that says "we fixed it in Update 2."

    connect.microsoft.com/.../debugger-stepping-in-mixed-mode-application-is-very-very-slow

  • Hi ta.speot.is,

    It looks like the bug that you are referring to is being tracked by the following:

    connect.microsoft.com/.../debugger-hangs-in-managed-code-in-mixed-mode-c-app

    The fix appears to be available in Update 3 CTP 1:

    www.microsoft.com/.../details.aspx

    Thanks,

    Brad

  • I cannot get this example started.  Your instructions say:

    "All you need to do is select your project and choose “Properties” from the context menu."

    I have VS 2013 update 3 and cannot find on my VS.  Why is that?

  • @James

    You need to open Solution Explorer (Ctrl+Alt+L) or from the View menu. Then right click your project and the context menu will appear.

Page 1 of 1 (4 items)