Converting console application to Windows Service

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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
S

Saad Rehmani

1. Extend System.ServiceProcess.ServiceBase for Runtime
2. Implement System.Configuration.Install.Installer for Installer

Good luck.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top