This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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