Skip to content

Instantly share code, notes, and snippets.

@csprofile
Created October 24, 2016 13:27
Show Gist options
  • Select an option

  • Save csprofile/ff852024189fcbc9df28540413130110 to your computer and use it in GitHub Desktop.

Select an option

Save csprofile/ff852024189fcbc9df28540413130110 to your computer and use it in GitHub Desktop.
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{
#if (!DEBUG) //Release
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new serviceClassName()
};
ServiceBase.Run(ServicesToRun);
#else
serviceClassName serviceClassName = new serviceClassName();
serviceClassName.StartApp();
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