c# - What windows service state is appropriate if OnStart failed -


i have windows service on c#.

in end of onstart set state service_running.

what would appropriate status if onstart caught exception?

also how should stop service in such event?

you may set status stopped , throw exception:

public override void onstart(string[] args) {     . . .     if(somethingwrong)         throw new exception("something wrong"); } 

Comments

Popular posts from this blog

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

matlab - error with cyclic autocorrelation function -

php - Using grpc in Laravel, "Class 'Grpc\ChannelCredentials' not found." -