What are windows services? How are they different from other .NET application? Any references or examples are welcome which sight the differences
4 Answers
Windows service is a Windows concept and generally does not really have anything to do with .NET per se other than that these could be written in .NET languages.
The main difference between a service and an ordinary windows app
- Services always run (usually started when computer boots; depending on design, you can manually stop or start these)
- Services have no UI (If you want to show UI from a service, you need to do it via a separate process) and mostly do not interact directly with users
- Services run in a separate Windows session (mostly, session 0) and, therefore, are (most always) shared between all users of a computer
- Services may offer recovery actions (what to do on first, second, and subsequent failures)
- Services are a bit harder to write and especially to debug. Thus, if thinking of writing a service, please consider console app + scheduled task first windows service vs scheduled task

- 1
- 1

- 1,675
- 10
- 18
Here's a good article about Windows Services:
Microsoft Windows services, formerly known as NT services, enable you to create long-running executable applications that run in their own Windows sessions. These services can be automatically started when the computer boots, can be paused and restarted, and do not show any user interface. These features make services ideal for use on a server or whenever you need long-running functionality that does not interfere with other users who are working on the same computer.
At the bottom of the article you have other links pointing to examples about how to create a Windows Service in .NET.

- 1,023,142
- 271
- 3,287
- 2,928
-
And what are the differences ? – Rohit Vipin Mathews Feb 27 '12 at 07:59
-
1The difference is that you are not manually calling some executable to start them but their are registered within Windows and then use the management console to start, top and resume them. Also as explained in the documentation they are not tied to the Windows session of the calling user. They run in their own Windows session. – Darin Dimitrov Feb 27 '12 at 08:00
-
i didnt find all these details while searching thats why i had to post this question – Rohit Vipin Mathews Feb 27 '12 at 08:03
-
@CodingMastero, I don't know how you were searching but the [following search](http://www.google.com/#hl=en&safe=active&sclient=psy-ab&q=windows+services+.net&pbx=1&oq=windows+services+.net&aq=f&aqi=g3g-m1&aql=1&gs_sm=3&gs_upl=918l3222l0l3342l21l17l0l2l2l2l465l3820l0.5.5.3.2l17l0&bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&fp=e6372d9bb62944f8&biw=1680&bih=945) provided lots of details. – Darin Dimitrov Feb 27 '12 at 08:05
-
i meant about finding the differences – Rohit Vipin Mathews Feb 27 '12 at 08:10
-
Well, once you read the documentation about Windows Services and understand how they work you could pretty easily figure out the differences. – Darin Dimitrov Feb 27 '12 at 08:11
-
i was looking for something that could straight away point out the differences! – Rohit Vipin Mathews Feb 27 '12 at 08:13
In Windows NT operating systems, a Windows service is a computer program that operates in the background. Windows services can be configured to start when the operating system is started and run in the background as long as Windows is running. Alternatively, they can be started manually or by an event.

- 1,965
- 23
- 24
Really, windows services are just a particular kind of program, which target the API defined in the System.ServiceProcess
namespace. If you check out the reference page, there's some good documentation on creating a service.
Aside from that, you're just writing a regular old .Net program.

- 18,915
- 3
- 47
- 72