Home c# C #, fails to run the Windows service

C #, fails to run the Windows service

Author

Date

Category

wrote a Windows service on C #. When starting, an error is issued: Unable to run the TFFU service to a local computer. Error 1053: The service did not respond to the request in a timely manner. Windows 7 SP1 x86. At the same time, the same service runs running on Windows 7 SP1 X64 and Windows 10. I install the service using Installutil. The service is empty. What could be wrong?

public service1 ()
  {
    Initializecomponent ();
    This.Canstop = True;
    this.canpauseAndContinue = True;
    This.autolog = True;
  }
  PROTECTED OVERRIDE VOID OnStart (String [] Args)
  {
    //trans.startTransfer ();
    Timer.Start ();
    Timer.elapsed + = New ElapsedeventHandler (OnelapsedTime);
    Timer.Interval = 30000; // Number in Milisecinds
    Timer.Enabled = True;
  }
Private Void OnelapsedTime (Object Source, ElapsedeventArgs E)
  {
   // here should be a program
  }

Answer 1

In fact, everything was simple. The computer was installed on the computer .NET 4.0, and in Visual Studio, the default project was created under version 4.6.1. After updating the version, the service started without any problems.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions