Error 1053: the service did not respond to the start or control request in a timely fashion

后端 未结 30 1292
無奈伤痛
無奈伤痛 2020-11-29 18:47

I have recently inherited a couple of applications that run as windows services, and I am having problems providing a gui (accessible from a context menu in system tray) wit

30条回答
  •  甜味超标
    2020-11-29 19:22

    In service class within OnStart method don't do huge operation, OS expect short amount of time to run service, run your method using thread start:

    protected override void OnStart(string[] args)
    {
        Thread t = new Thead(new ThreadStart(MethodName)); // e.g.
        t.Start();
    }
    

提交回复
热议问题