Created
March 20, 2011 19:37
-
-
Save alfeg/878596 to your computer and use it in GitHub Desktop.
Topshelf configurator example
This file contains hidden or 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
RunConfiguration cfg = RunnerConfigurator.New( | |
x => | |
{ | |
x.ConfigureService<SomeClass>(c => | |
{ | |
c.WhenStarted(s => s.BootHost()); | |
c.WhenStopped(s => s.ShutDownHost()); | |
c.WhenPaused(s => s.ShutDownHost()); | |
c.WhenContinued(s => s.BootHost()); | |
c.HowToBuildService( | |
s => new SomeClass()); | |
}); | |
x.SetDescription("My Service"); | |
x.SetDisplayName("Display name for service"); | |
x.SetServiceName(AppConfig.ServiceName); | |
x.RunAs(AppConfig.ServiceUser, AppConfig.ServicePassword); | |
x.DependencyOnMsmq(); | |
}); | |
Runner.Host(cfg, args); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment