Windows Services in .NET
page 10 of 10
by Kavitha Pradeep
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 68573/ 117

Various Classes Available in .NET to Deal with Windows Services

The System.ServiceProcess namespace provides classes that allow you to implement, install, and control Windows service applications. The various classes available within this namespace are:





Provides a base class for a service that will exist as part of a service application. ServiceBase must be derived when creating a new service class.


Represents a Windows service and allows you to connect to a running or stopped service, manipulate it, or get information about it.


Allows control of code access security permissions for service controllers.


Allows declarative service controller permission checks.


Defines the smallest unit of a code access security permission that is set for a ServiceController.


Contains a strongly-typed collection of ServiceControllerPermissionEntry objects.


Installs a class that extends ServiceBase to implement a service. This class is called by the install utility when installing a service application.


Specifies a description for a property or event.


Installs an executable containing classes that extend ServiceBase. This class is called by installation utilities, such as InstallUtil.exe, when installing a service application.


The exception that is thrown when a specified timeout has expired.





Indicates the system's power status.


Specifies a service's security context, which defines its logon type.


Defines access levels used by ServiceController permission classes.


Indicates the current state of the service.


Indicates the start mode of the service.


Represents the type of the service.


By taking advantage of the Framework Base Classes, the complexity needed to create a service is greatly reduced. This lets the developer to concentrate more on the functionality of the service instead of spending time in creating it.

View Entire Article

User Comments

Title: Windows Services   
Name: S.B.krishna Reddy
Date: 12/31/2010 4:29:52 AM
The images u have presented in the web page are not proper and not showing the clear view
Title: Windows Service in .NET 2   
Name: sbanik
Date: 10/14/2009 6:24:58 AM
Title: Windows Services in .NET   
Name: Nanthakumar
Date: 10/16/2008 6:53:15 AM

This is Very Useful my project..

Title: Extremely helpful, even after 4 yrs~   
Name: Rajeev
Date: 6/12/2008 4:40:13 AM
Thanks a lot for this article. It's been 4 yrs since it was authored, but yet it is so useful for beginners.

Thanks a ton.
Title: Learned Windows services   
Name: Debasmit Samal
Date: 1/23/2008 1:16:47 AM

Thanks a lot and lot for the article.
Really i got basic concepts for the windows services.

Thanks again for such a nice article.
Title: Windows Service   
Name: Rohini S
Date: 1/22/2008 3:28:06 AM
It is an excellent tutorial. It covers basics of Windows service. It is a good for beginners
Title: Crystal report autogeneration using windows services   
Name: Rajesh m
Date: 8/9/2007 9:03:43 AM
Hi All,
I developed windows service which will daily at 12:00pm generate crystalreports and mail is sent to the mail with crystal report attached. Here my problem is it works fine in my system..but when i put in testing server it is not working...
Title: windows service   
Name: pawar megha p.
Date: 5/3/2007 5:00:26 AM
very good article for windows services.i have problem for writting the Installutil.exe in command propmt of gives no file found,so what may be the problem?

Title: Windows Service   
Name: M.Mansoor AliKhan
Date: 11/13/2006 2:32:37 AM
This is really a knowledge providing article.

Thanks ..
Title: Running Windows Service from Web Service   
Name: Shantanu Karmakar
Date: 8/18/2006 6:19:41 AM
I'm having a problem to start and stop a windows service from my web service. It's giving an exception InvalidIOException - Couldn't strat service. Can any one help in this regard? I think the problem is with the security.
Title: How do we programmatically configure a Windows Service to interact with the desktop?   
Name: Shashi Kumar
Date: 7/29/2006 9:15:19 AM
Can u please let me know how do I make the windows service interact with the desktop since the windows service has to invoke a windows application upon its successful start?
Please let me know where exactly a property called "AllowServiceToInteractWithDesktop" exists and how do I use it?

I have been struck for quite sometime now... and any help would be greatly appreciated.

Feel free to mail me at

Thanks in advance.
Title: Webservice   
Name: Mahendra
Date: 7/19/2006 1:58:51 AM
this is really a knowledge providing article.
Title: User Interface   
Name: Uli
Date: 6/20/2006 8:14:30 PM
"Although it’s possible, Windows Service typically has no user interface."

Hi, great article, how can I find more information about creating a windows service with windows interface, so far everytime that my windows service timer goes off and executes some code, all the functionality will work as needed but because it won't show the form that I developed (This is actually my biggest problem), it will limit my application's functionality.

Any ideas???

If you guys have something please let me know:

Title: windows services   
Name: shan
Date: 5/8/2006 10:45:38 AM
this explaination is good but is this possible to install the windows services without the use of installutl i mean calling just the function install() , i tried it but its giving "no object reference " problem i think the problem is with the hashtable may be its not having the proper context?
i need ur help
Title: Windows Service Behaviour   
Name: Deepak
Date: 4/27/2006 7:28:58 AM
Hello, I have problem with Windows Service that I have created in VB.Net its behaviour is really strange i.e.Sometimes after Istallation and Start it runs but sometimes it just stucks somewhere.Then again this service needs to be re-installed(not just restart) then it runs perfectly very well.
This service does some Asynchronous task using delegates.
I could not understood this behaviour,let me know how can I understand it or what could be reasons.

Title: windows services   
Name: shravan
Date: 4/3/2006 4:24:51 AM
this is ok
now whether this is possible to install this service without installutil.exe i mean just adding entries in the registry by urself
well i am a newbie

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2015  |  Page Processed at 12/2/2015 1:55:28 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search