Switching to Managed Compatibility Mode in Visual Studio 2013

Switching to Managed Compatibility Mode in Visual Studio 2013

Rate This
  • Comments 40

In Visual Studio 2012, we introduced a new managed debug engine that provides us the ability to more rapidly add new features compared to the older implementation. This can be seen by the number of features introduced in Visual Studio 2013 after only a single year including Managed Return Values, .NET 64-bit Edit and Continue, Async Callstacks Enhancements, and Improved Tasks Window to name a few. Unfortunately, there are still a couple scenarios that are not supported yet with the new debug engine, so in these cases you will have to switch back to the legacy engine.

To most Visual Studio developers, the current debug engine should only have a positive impact and you need not worry about what happens under the covers. While eventually we plan to completely replace the legacy engine, there are still
two scenarios where it is needed. In this blog post, I will show you how to switch to managed compatibility mode, which you should do ONLY if you have interest in the two scenarios that the current engine does not yet support.

  1. You are using a .NET language other than C#, VB, or F# that provides its own Expression Evaluator (this includes managed C++)
  2. You want to enable Edit and Continue (EnC) for C++ projects while mixed mode debugging

If these scenarios do not apply to you, there is no need for you to switch back to the legacy debug engine.

[DISCLAIMER] Enabling Managed Compatibility Mode will disable many features that depend on the current debugger implementation to operate. It is our goal in the future to completely remove the legacy engine from the product and hence remove the options discussed later in this blog post.

With the disclaimer out of the way, and only if you care about the two aforementioned scenarios in VS2013, please feel free to read on to find out how to enable the legacy managed debug engine through the global options, for an EXE project, during attach, and manually through the project file.

Global Options

To switch back to the legacy debug engine globally, select Tools/ Options ...


then check Use Managed Compatibility Mode on the Debugging / General tab.

The global option will force the legacy engine to be used for any launch or attach.

EXE Project

The exe project system is used when the user invokes File / Open Project, and then selects an existing exe file. To specify the legacy debugger engine, choose Project / Properties and then set the Use Managed Legacy Engine to Yes on the General project property page. This setting takes precedence over the Tools / Options setting.


Attach to a Process

To specify the legacy debug engine when you attach to a process, choose Debug / Attach to Process. window

 Then click the Select button on the Attach to Process dialog.

 On the Select Code Type dialog, make sure the right version of Managed code is selected, and then select Managed Compatibility Mode.



Through the .csproj/.vbproj file

Hand editing the .csproj/.vbproj, by adding the ‘DebugEngines’ property within ‘PropertyGroup’, you can force the project to use the legacy debugger engine. To enable managed compatibility mode, define the property like this:

<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>



IMPORTANT NOTE: If your project is using the Visual Studio hosting process (the default for many project types), you must disable the hosting process for this fix to correctly change the debug mode. To disable the hosting process go to the Debug pane on the project properties page, and uncheck "Enable the Visual Studio hosting process"

Additionally if you are using this with Managed C++ code and want to also debug native code you will need to add the native debug engine GUID (shown below) to the <DebugEngines> property delimited by a semicolon , manually setting the property overrides the options you can set in the UI including the "Enable native code debugging" checkbox.  So the property should be:


In Closing

We hope that if you require managed compatibility mode, one of the above options will meet your needs. We are currently working hard to enable these capabilities in the current debug engine.

If any of you have feedback or questions about this, please let me know in the comments section below or in our MSDN forum.

Leave a Comment
  • Please add 2 and 8 and type the answer here:
  • Post
  • @ I_C

    It might, as it's a broader fix.

    Would you mind sending me a repro (I can't repro these) so I can check to make sure? You can email me at vsdbgfb@microsoft.com

  • In a mixed C++ Windows Forms App in 2013 the debugger can't even resolve a simple std::wstring. Can this be fixed? To reproduce, open a C++ Windows Forms App or create one and declare a std::wstring in the form constructor. When debugging you can't see it's value.

  • @Adam Bruss

    Thanks for pointing this out, we will investigate this and let you know.

    Also - is there an reason you posted this issue here? Does it repro with/without Managed Compatibility mode?

  • Hi Maria,

    The problem happens if Managed Compatibility mode is on or off. I've created a Microsoft Connect issue here.


    I posted here because it looked like you were actively fielding issues and it's somewhat related. This worked in Visual Studio 2008. It didn't work in Visual Studio 2012. We were hoping it would be fixed for Visual Studio 2013. It seems like a basic thing.

  • Thanks! Someone will take a look!

  • Alright thanks Maria. I really hope someone does look into it and can at least let me know what the deal is. It's quite frustrating debugging a large C++ mixed application the way it is.

  • Maria, there are no updates to my Microsoft Connect issue yet. Do you know if someone is looking at it?

  • @Adam Bruss

    The way customer bugs work, is that we have a first triage team that tries to repro and then passes them along to the feature teams. They couldn't repro your issue, but it is now assigned to someone on the C++ team to take a look at. They should keep you updated with the progress - ping them on the bug, as they should receive emails when it gets updated!

  • Major Kudos to the Microsoft team for all the additions to VS2013! I can't express how much I missed Intellisense, and the performance of "Go to Definition" makes this a usable feature again.  Having to use comparability mode for debugging is not a big deal in comparison and I look forward to having these new features for VC++ projects.


  • I found that another place this is needed when attempting to watch a variable that's created using the Moq mocking framework.

  • I'd like to also add that since VS2012 I've been unable to attach and debug when I have a lot (read 100s) of DLLs loaded in my service.  The .NET-based framework I'm using is basically a large plug-in system that allows for a developer to create their own DLL-based modules to perform tasks and while I can still debug with VS2010, I'm only able to debug with VS2012+ when I enable the managed compatibility mode.  When I attach, it feels like it only loads N number of DLLs for debugging and after some threshold it stops loading symbols.

  • All the DLLs mentioned in my previous post are C# DLLs, we are not running in any mixed mode.  Just C# DLLs compiled for Any CPU running on Server 2012 and Server 2012R2 with VS2010, VS2012 Update 4, and VS2013 Update 4.

  • @Brian A

    Unfortunately that is a known OS limitation, for 64 bit apps. It only happens on attaching, not if you launch the app directly from the debugger. And it happens for WinDBG as well. The Windows kernel team has been made aware of this.

  • @Brian A

    Forgot to mention - the limit is 500

  • @Maria

    What I've noticed can't be the OS as if I attach with VS2010 I can hit my breakpoints (currently have over 800 DLLs in my assembly cache loaded).  I can also debug using VS2012/VS2013 if I enable the compatibility debugger in the VS settings. I'm trying to figure out how to recreate the issue but cannot share my binaries so this will be difficult.

Page 2 of 3 (40 items) 123