Link to home
Start Free TrialLog in
Avatar of timberbt
timberbt

asked on

.Net windows service how to stop itself?

I'm making my first windows service and I'm going back and doing some error coding where I want the service to actually stop itself.

I don't see any real methods for closing the service. I don't see any .close() or unload or anything like.

Could someone help me out here for how to let this guy stop gracefully? thanks.

=Timberbt
ASKER CERTIFIED SOLUTION
Avatar of Sector
Sector

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DanRollins
Hi timberbt,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept Sector's comment(s) as an answer.

timberbt, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
Avatar of timberbt
timberbt

ASKER

Question was not really settle, so closing as unanswered is OK.
hi timberbt,
Thanks for returning to this old thread.  I disagree with your assessment.   Did you read the information at Sector's links?  There is excellent information there, including info about the System.ServiceProcess.ServiceController class that answers your question completely.  

Are you certain that you do not want to give Sector any credit?
Half points refunded.  Accepting Sector's answer.

SpideyMod
Community Support Moderator @Experts Exchange