开发者

Facing Error 1053 in case of windows service

I made a windows service. My code is similar to:

onstart()
{
    while(true)
    {
        //code
    }
}

I am trying to update my d开发者_如何学编程atabase every minute. The service builds properly and installed properly, but when I start the service it gives error 1053. I have tried alot to solve it but not get any solution.


protected override void OnStart(string[] args)
{
    //put debugger.launch the first statement of OnStart...and make sure you running in    debug mode
    Debugger.Launch();

    try
    {

      //your code
      . 
      .
      .
    }
    catch(Exception ex)
    {
        //see what exception is coming
    }


}


Did you define onStop?

The ServiceBase class calls the OnStop method directly from the Service command handler that is defined in the ScDispatcherLoop of the Advapi32.dll file. After 30 seconds, if the ScDispatcherLoop thread is not ready to receive a new service command from the service control manager, Windows Service Controller marks the service as "time out." Therefore, you receive this error message. -Microsoft


Go to the console of the server (in the server room if you will) and start the Window Service. Remote in won't work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜