4

I'm working on C# COM component. This component is called from application plugin and when I manually attach debugger to the application, it stops on breakpoints. But when I use Visual Studio debug command (F5 key) and specify "Start external program" in project debugger settings, Visual Studio does not stop on breakpoints.

In short: * set breakpoint, compile, start app, attach debugger to debug "Managed (v2.0, v1.1, v1.0) code", exec plugin method - VS stops on breakpoint. * set breakpoint, specify Start external program, press F5 - application starts, exec plugin method - VS skips breakpoint. "Attach To..." command shows ProteusDebugEngine instead of some kind of managed code.

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Alex Netkachov
  • 13,172
  • 6
  • 53
  • 85

1 Answers1

3

The problem is that the debugger cannot figure out which of its two engines to use because the application that is starting is not a managed one. So it defaults to the 4.0 engine. You have to tell the debugger that you want a different engine by explicitly telling it what runtime is being used.

Create or edit a config file for the application that you are wanting to debug and add a SupportedRuntime element to it.

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

See MSDN blog entry.

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Spencer Booth
  • 1,532
  • 1
  • 11
  • 15