Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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