How to cancel service startup during OnStart?

S

SharpCoderMP

hi,

as in subject - how can i do that?
when my service starts up it performs some tests within OnStart method.
i would like it to refuse to start if some of these tests fail. there is
simply no point in running my service if certain criteria is not met. in
that case i would like to log test results and just stop. calling
this.Stop() inside OnStart method does not sound like a good idea :/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top