i have a simple c# application that needs to run as service. how do i make it run as a service instead of just as an executable?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Visual C# 2010 Recipies has an example in it which will show you exactly how to do this, which I’ve tried using VS 2008 and .NET 3.5.
It amounts to this:
Add a Service Installer class to your Windows Service project – it’ll look something like this code snippet below:
Finally you’ll use a command line utility to actually install the service – you can read about how that works here:
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/d8f300e3-6c09-424f-829e-c5fda34c1bc7
Let me know if you have any questions.