Debugger.Launch() on windows service in Windows 8

后端 未结 3 783
无人共我
无人共我 2021-01-05 13:16

After I installed Windows 8 perfectly legit statement like this doesn\'t work anymore:

#if DEBUG
    Debugger.Launch();
#endif

Service star

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-05 13:47

    The secret lies in changing the registry key for the Visual Studio JIT debugger via the following:

    reg add "HKCR\AppID\{E62A7A31-6025-408E-87F6-81AEB0DC9347}" /v AppIDFlags /t REG_DWORD /d 8 /f
    

    Before making this change the value on my machine was 0x28. The above changes it to 0x8. In essence it removes the 0x20 flag.

    If you search the Microsoft include files (WTypesbase.h) then you find the following:

    #define APPIDREGFLAGS_IUSERVER_ACTIVATE_IN_CLIENT_SESSION_ONLY 0x20
    

    Once you make this change then the JIT debugging window is displayed again. I believe that all of this relates to various session 0 security changes made by Microsoft.

    Sourced from this post: http://forums.arcgis.com/threads/69842-Debugging-your-SOE-on-Windows-8

提交回复
热议问题