Have you ever created a desktop application that should have been a Windows service? After seeing how easy it is to create Windows Services in .NET, do you have plans to rewrite those applications? Did this article give you ideas for new services? Have you had any problems building services in .NET? Let us know in the vb.dotnet.technical discussion group.
When you need to run unattended applications that can monitor directories and log events, don't even think about writing a desktop applicationwrite a Windows service instead.
by Peter G. Aitken
October 21, 2002
uppose that your company's field reps regularly upload files to the server, and the proper people need to be notified when these files arrive. Perhaps you need to monitor and log the creation of new folders, to ensure that certain files remain read-only, or to gather use data for reports. These and many other similar tasks are certainly within the capabilities of a standard Windows desktop application, and this is the approach that many developers and system administrators take, either running the application continuously or at regular intervals with the help of the Windows Scheduler. While common, this approach is a pretty sure invitation to headache-city. Being desktop apps, such programs are susceptible to intentional or unintentional fiddling from users. In addition, they require some account to be logged on in order to run.
Fortunately there's a much better alternative for applications that run for extended periods and do not require user interaction: a Windows service. While Windows service applications (previously called NT Services) have been around for a while, they were a real bear to program. With .NET, this has changed. The .NET Framework provides classes that greatly simplify the tasks of creating, installing, and controlling Windows service applications.
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!