Visual Studio 2010 does not stop at a breakpoint when debugging C # COMVisible class methods

I am working on a C # COM component. This component is called from the application plugin, and when I manually attach the debugger to the application, it stops at breakpoints. But when I use the Visual Studio debugging command (F5 key) and set "Run external program" in the project debugger settings, Visual Studio does not stop at breakpoints.

In short: * set a breakpoint, compile, run the application, apply a debugger for debugging "Managed (v2.0, v1.1, v1.0) code", exec plugin method - VS stops at the breakpoint. * set a breakpoint, specify Run an external program, press F5 - start the application, start the method plugin - VS skips the breakpoint. The Attach To ... command shows ProteusDebugEngine instead of any managed code.

+4
source share
1 answer

The problem is that the debugger cannot determine which of its two engines to use, because the running application is not controlled. Thus, it works by default with the 4.0 engine. You must tell the debugger that you want a different engine, explicitly telling it which runtime to use.

Create or edit a configuration file for the application you want to debug, and add the SupportedRuntime element to it.

<?xml version ="1.0"?> <configuration> <startup> <supportedRuntime version="v2.0.[version on your machine]" /> </startup> </configuration> 

See the MSDN blog post .

+3
source

Source: https://habr.com/ru/post/1337403/


All Articles