Skip to content

Instantly share code, notes, and snippets.

@SuperYeti
Created July 20, 2011 07:14
Show Gist options
  • Select an option

  • Save SuperYeti/1094500 to your computer and use it in GitHub Desktop.

Select an option

Save SuperYeti/1094500 to your computer and use it in GitHub Desktop.
static void Main()
{
#if DEBUG
// Run as interactive exe in debug mode to allow easy
// debugging.
CCCS_Global_SVC service = new CCCS_Global_SVC();
service.OnStart(null);
// Sleep the main thread indefinitely while the service code
// runs in .OnStart
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
#else
// Run normally as service in release mode.
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[] { new CCCS_Global_SVC() };
ServiceBase.Run(ServicesToRun);
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment