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, yo开发者_JAVA技巧u 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?
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
精彩评论