Skip to content

Instantly share code, notes, and snippets.

Embed
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.RunAsLocalSystem();
x.SetDescription("This is a demonstration of a Windows Service using Topshelf.");
x.SetDisplayName("Self Host Web API Demo");
x.SetServiceName("AspNetSelfHostDemo");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.