Thursday 15 January 2015

c# - Why won't this service start -


I have a Windows service that makes me have some problems.

There are appropriate functions as follows:

(edited to reflect current)

  static zero main () (if (debugger. ISHATED) {Continued Service Service = New Continuous Service (Service) • Start (New Object [] {}); While (True) Thread.Sleep (1);} Other {ServiceBase [Services] ServicesToran; ServicesToRun = New ServiceBase [] {New ContinuumService ()} ServiceBase.Run (ServicesToRun);}} Public Consignment Service () {Initial Group ();} Safe Override Turn On Zero (String [] Argos) {base.OnStart (args);} Secure Override Zero OnStop () {base.OnStop ();}   

Service to interact with my installer 'desktop Allow '(as I can not seem to get service without this), and I know that the service is being set up - but is unable to start for any reason. / P>

It is my understanding that a service start command will execute the command and Will wait to complete the pattern. If the process is still ongoing, so ongoing service reports ... Please let me know if it is skewed.

I have an exact error getting back from the installer 'service' [display name] '([name]) failed to start. Verify that you have sufficient privileges to start system services. '; And from the generated log on the back of the installer, I get an error with a single message of 190.

In either case - I can not come with a valid reason because this will be the case. Any advice would be great.

I believe your problem is the lack of both loops and the base. OnStart () and base .OnStop () Call You can start and stop the basic service without any loops, and it will run continuously. Example basic service that does not really do anything:

  public class example service: servicebase {private static zero main () {ServiceBase.Run (new [] {new instance service}); } Public ExampleService () {// Service service name = "Example service" name; } Turn on safe override zero (string [] args) {base.OnStart (args); // nothing} protected override zero onstop () {base.OnStop (); }}   

Try to implement it, see that it works, and increases your logic and test.

No comments:

Post a Comment