Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syron/afc53f0b17ee33f9715b7d0a8fa68ffd to your computer and use it in GitHub Desktop.
Save syron/afc53f0b17ee33f9715b7d0a8fa68ffd to your computer and use it in GitHub Desktop.
static void Main()
{
#if (!DEBUG)
System.ServiceProcess.ServiceBase[] ServicesToRun;
ServicesToRun = new System.ServiceProcess.ServiceBase[] { new Service1() };
System.ServiceProcess.ServiceBase.Run(ServicesToRun);
#else
Service1 service = new Service1();
service.Init();
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment