VS 2012 在 windows 8 中无法使用 Deubgger.Lunch() 对服务进行调试
找到了外文资料:
Debugger.Launch() not displaying JIT debugger selection popup on Windows 8/8.1
If executing an instruction such as Debugger.Launch() inside a Windows Service (session 0 process) is not causing the display of the JIT debugger selection popup even if Visual Studio is indeed installed on your machine, it might be due to the current value of the registry key for the Visual Studio JIT debugger. To this end it might solve running the following from a command prompt (run it as an administrator on Windows 8/8.1):
reg add "HKCR\AppID\{E62A7A31-6025-408E-87F6-81AEB0DC9347}" /v AppIDFlags /t REG_DWORD /d 8 /f
要使用具有管理员权限的Cmd窗口
For full details read the following blog post:
Also make sure your JIT settings in Visual Studio are correct:
http://msdn.microsoft.com/en-us/library/5hs4b7a6.aspx
解决方式已找到,原因还没有仔细阅读。不过执行命令时需要注意,要使用具有管理员权限的Cmd窗口。