Refactor the code, add server app, set the service to windows service.