How to make a C Sharp 2010 application run as a service?

Hello everyone,
          I am kind of new in Microsoft technology and I need to put a C Sharp application to run as a service. This application has 9 different projects on it that run at the same time. All of them get call by the main thread or project.

After we finish testing, we need to put this application to run as a service and I need to know how to do this.
the OS is Windows Server 2008 R2 Standard
      64 bit Operating System

We have three servers, Principal, Mirror, and witness. I need to do this in both, Principal and Mirror.

Any link of a manual or tutorial will be useful.
Thank you
Who is Participating?
iscivanomarConnect With a Mentor Author Commented:
I need to defined SQL Server Service as required to start first. How can I do this?

Ones I create the Service, how can I assign My C Sharp application to it?

Thank you.
serchlopConnect With a Mentor Commented:
This can also be done via command prompt using the sc command. The syntax is:

sc config [service name] depend= <Dependencies(separated by / (forward slash))>

Note: There is a space after the equals sign, and there is not one before it. So if you want ServiceA to depend on both ServiceB and ServiceC--that is to say, ServiceA will not start until the other two have started--then you would use this:

sc config ServiceA depend= ServiceB/ServiceC

Edit: Also, if you want to remove all dependencies, you have to use the following syntax:

sc config ServiceA depend= /

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

serchlopConnect With a Mentor Commented:
iscivanomarAuthor Commented:
Thank you for you comments, I am going to try this tomorrow and I will let you know how it went.

Thank you.
iscivanomarAuthor Commented:
Thank you serchlop for all your useful information. I did not know anything about this but now, I know what I am doing.

Have a good day.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.