Converting console application to Windows Service

  • Thread starter Thread starter asadikhan
  • Start date Start date
A

asadikhan

I have written a console application that clears out some folders. I
want this application to run as a Windows Service (not a scheduled
task). What is the easiest way to convert this console application into
a Windows Service using Visual Studio .Net?

Asad
 
Asad,

Why not have it run as a scheduled task?

I ask this because when you run a console app, there is some external
stimuli which triggers the execution of the task. With a service, it is
always running, so you need to specify when your service does something.

After all, I dont think you want it to just continuously clear out some
folders over and over and over again. It would be a tremendous waste of
resources.
 
1. Extend System.ServiceProcess.ServiceBase for Runtime
2. Implement System.Configuration.Install.Installer for Installer

Good luck.
 
Back
Top