Skip to content

Instantly share code, notes, and snippets.

@jaysonrowe
Created September 20, 2012 01:53
Show Gist options
  • Save jaysonrowe/3753528 to your computer and use it in GitHub Desktop.
Save jaysonrowe/3753528 to your computer and use it in GitHub Desktop.
TopShelf Main
public static void Main()
{
HostFactory.Run(x =>
{
x.Service<AutoSQLRestore>(s =>
{
s.ConstructUsing(name => new AutoSQLRestore());
s.WhenStarted(tc => tc.Start());
s.WhenStopped(tc => tc.Stop());
});
x.RunAsLocalSystem();
x.SetDescription("Automatic SQL Restore");
x.SetDisplayName("ASR");
x.SetServiceName("ASR");
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment