Service In Perpetual “Starting” Status

旧街凉风 提交于 2019-12-20 03:29:14

问题


I've written a windows service in C# that converts wav files into mp3 and then stores them on a remote server. On my development rig (OS: WinXP SP3) the service starts up fine and runs the way it's supposed to.

When I installed it the production machine (OS: WinServer 2000), upon starting the service it fails to start in a timely fashion, and remains in a constant "Starting" status. The program is clearly working though since the files are being converted and transferred.

My hunch is that the problem is in the timer component, I think that on the Windows 2000 Server machine, the timer may be causing the system to register the program as "Starting".

Is there something I'm missing about Windows Server 2000?


回答1:


I'm not familiar with writing services in .NET, but in general, the thread that is used to start the service and report its initial status should not be the same thread that performs the actual work. The service should spawn a worker thread so the entry point can return status to the SCM quickly.



来源:https://stackoverflow.com/questions/1095498/service-in-perpetual-starting-status

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