Search code examples
c#serviceconsole-applicationtopshelf

Console App to Services


I'm working on a project who use a Forex API.

So basicaly, what she do: Loop to check if a new value exist, if she exist, put it in MongoDB Collection. if not, keep looping.

My console work just fine but what I need to do is to make it works as Services.

What I've done:

  • I've already create my InstallerService and my Service1.cs
  • I've used (Environement.UserInterface) in my entry point to make it work as Console App to make the debug painless, and as Service.

When I use installutil.exe, it's complete perfectly and it appear in my service.msc. I can start it and stop it.

BUT, it seems he don't receive any data, and so, don't put anything in the base. Although it's work perfectly fine as Console App.

So, if anybody have any idea of what it could come from. I would apreciate some help.


Solution

  • If you have a console application I would suggest just using Topshelf