• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

.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
0
timberbt
Asked:
timberbt
1 Solution
 
DanRollinsCommented:
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
0
 
timberbtAuthor Commented:
Question was not really settle, so closing as unanswered is OK.
0
 
DanRollinsCommented:
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?
0
 
SpideyModCommented:
Half points refunded.  Accepting Sector's answer.

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now