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

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -