Skip to content

Instantly share code, notes, and snippets.

Created July 24, 2015 02:39
What would you like to do?
HostFactory.Run(x =>
x.Service<TopshelfService>(s =>
s.ConstructUsing(name => new TopshelfService());
s.WhenStarted(tc => tc.Start());
s.WhenStopped(tc => tc.Stop());
x.SetDescription("This is a demonstration of a Windows Service using Topshelf.");
x.SetDisplayName("Self Host Web API Demo");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment