Convert C# console app into a Windows Service
Posted on 2004-08-19
I have a multithreaded C# Console app that needs to run every minute or every 30 seconds 24/7/365. There is nothing in the code related to a timer or Windows service (although that can be modified as I have the source) I can think of some ways of accomplishing that:
1. Leave console app code as it is and separately write a Windows Service that "calls" the app after every interval
2. Somehow modify the source code of the console app so it becomes a service with all the funcionality of the original app
Unfortunately, I have tried and don't know enough about Windows Service coding to make this work. Right now I have a Windows Service separately that just writes text to a file on startup and and on shutdown. I don't know how I can merge the Console App into this service and also add a timer into the final product.