Debugger.Launch() on windows service in Windows 8

后端 未结 3 804
无人共我
无人共我 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:39

    Is this a Windows Store app or a desktop app?

    Try right-clicking on your project (the C# executable project if that's what you have) and selecting "Properties". Then in the left sidebar of options, click "Debug". In the "Start Action" section, check the box for "Do not launch, but debug my code when it starts".

    Now you can hit F5 and run Visual Studio with breakpoints in your code, and it will sit and wait for you to fire up the process. Then run your application (outside of Visual Studio), and Visual Studio will attach the debugger.

    Do Not Launch option in Properties

提交回复
热议问题