How to debug the .NET Windows Service OnStart method?

后端 未结 16 1297
离开以前
离开以前 2020-12-01 00:13

I have code written in .NET that only fails when installed as a Windows service. The failure doesn\'t allow the service to even start. I can\'t figure out how I can step int

16条回答
  •  庸人自扰
    2020-12-01 00:42

    Try adding Debugger.Break inside the problematic method. When the service will start an exception will be thrown and widows should offer to debug it using visual studio.

提交回复
热议问题