tags:

views:

33

answers:

0

I have a Windows service implemented in C++. It is mostly native code but has a dll which is .net.

I use __debugbreak() to force the debugger open at a breakpoint if there is an error during service start up.

The breakpoint works fine until I call gcnew on a managed class ( with an empty constructor!) from the native code. After that a programatic breakpoint will not open the debugger. I tried using __debugbreak() __asm int 3 assert( 0 );

The assert(0) actually opens a dialog but hitting retry does not bring up the debugger....

Attaching to the running process does still work ok. So I am just getting messed with the programatic break points and managed code.

I set the registry

HKLM:\software\Microsoft.NETFramework> DbgManagedDebugger : "c:\WINDOWS\system32\vsjitdebugger.exe" PID %d APPDOM %d EXTEXT "%s" EVTHDL %d DbgJITDebugLaunchSetting : 2

I am running Windows Xp sp 3 32 bit .net 3.5

So my question is, how do I fix this?