How to exit service at OnStart() stage

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a windows service. The OnStart() method initializes the service and
gets it ready for other tasks. In some circumstances, the initialization in
OnStart() could fail. And sometimes the failure is so catastrophic that it
makes no sense to keep the service running. In this case, how can I exit the
service and pass the service status to SCM?

Thanks in advance.
 

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

Back
Top