How to debug windows service which fails in Init() method

你。 提交于 2019-12-06 14:17:57

you can programatically attach the debugger as the first line in the function:

Debugger.Launch ();

after adding the using statement:

using System.Diagnostics;

What I usually do is to have a class with a static void Main() entry point, which I can then temporarily assign in the project properties. From there, I call the same startup functions that are called when the app is run as a service.

probably you can get the dumps of the crash using DebugDiag or windbg.

is your service C++ or C#.

Also maybe it is just a first chance exception and not really a crash. Can you provide more info on the failure.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!