Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`Use managed compatibility mode` or `Enable native code debugging`?

I write .net-plugins for Autodesk Revit. Revit is unmanaged application. So, for successfully debugging I am to set into ON either for Use managed compatibility mode option or for Enable native code debugging option (or for both of them). Otherwise debugging cannot be launched.

The first of them is applied for all projects. The second of them is used for each project individually.

enter image description here

What the difference of these options? I don't understand what they do. What option it is more correct to use in my case?

like image 663
Andrey Bushman Avatar asked Feb 10 '17 11:02

Andrey Bushman


People also ask

What is use managed compatibility mode?

Use Managed Compatibility Mode: Replaces the default debugging engine with a legacy version to enable these scenarios: You are using a . NET language other than C#, Visual Basic, or F# that provides its own Expression Evaluator (this includes C++/CLI).

How do I enable native code debugging?

Enable native code debugging in the properties. For C#, select Debug in the left pane, select Open debug launch profiles UI, then select the Enable native code debugging check box, and then close the properties page to save the changes.

What is a native debugger?

Photo by Timothy Dykes on Unsplash. React Native Debugger is a powerful tool that helps developers debug React Native applications more quickly. It provides a suite of impressive features, such as UI inspector, redux inspector, breakpoints and networking inspector.

How do I enable debugging in Visual Studio?

In the Visual Studio toolbar, make sure the configuration is set to Debug. To start debugging, select the profile name in the toolbar, such as <project profile name>, IIS Express, or <IIS profile name> in the toolbar, select Start Debugging from the Debug menu, or press F5.


1 Answers

You do not have to enable unmanaged debugging to debug your plugin. Breakpoints in your code will activate (turn from hollow to solid) when the host application loads your add-in. If you are not sure if this happened then have a look at the Debug > Windows > Modules window.

Enabling unmanaged debugging does not otherwise greatly affect the debugging session, it can however take quite a bit longer to get started and you may need to temporarily disable the symbol server to avoid getting annoyed at it.

The Tools > Options settings have rather poor names. Microsoft has been working on new debugging engines but was forced (or chose) to drop some features. "Use Managed Compatibility Mode" forces an older version of the managed debugger to be loaded, the one that was used in VS2010. It is required when you debug C++/CLI code. It can be also useful in VS2015, its managed debugging engine is very buggy. You'll miss out on some new debugging features like return value inspection and 64-bit edit+continue. You don't otherwise need it to debug your add-in.

Much the same story for "Use Native Compatibility Mode", it enables an older version of the unmanaged debugging engine, the one in VS2012 afaik. You'll miss out on the new Natvis visualizers. I have not yet found a compelling reason to need it, other than keep the old visualizers working.

like image 159
Hans Passant Avatar answered Nov 16 '22 03:11

Hans Passant