Ben Fulton
Ben Fulton

Reputation: 3998

Attaching a debugger to a running process on Vista or Windows 7 using Debugger.Break()

When encountering a Debugger.Break() statement on Vista, you will get this message instead:

"SomeProcess.exe has encountered a user-defined breakpoint."

If you click options in the right order, you might be able to attach your debugger. if you don't, you won't. How do you force Windows to give you the Attach dialog every time?

Upvotes: 3

Views: 879

Answers (1)

Ben Fulton
Ben Fulton

Reputation: 3998

There is a registry entry that forces this behavior.

This registry setting is located at [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\ DbgJITDebugLaunchSetting].

It has a default value of 16. Change it to 2 and the JIT debugger dialog will be displayed immediately.

http://bphillips76.spaces.live.com/blog/cns!F9B548E4C21D6166!364.entry

Upvotes: 4

Related Questions