Topshelf is not working when I add whencontinued in the configuration. It is working fine with start and stop methods. I do not have any code in continue method that would block it from running ( simple console.writeline )
HostFactory.Run(x =>
{
x.SetDescription("Data Service - POC");
x.SetDisplayName("Data Service");
x.SetServiceName("DataService");
x.EnablePauseAndContinue();
x.Service<SampleService>(s =>
{
s.ConstructUsing(() => new SampleService());
s.WhenStarted(v => v.Start());
s.WhenStopped(v => v.Stop());
// s.WhenContinued(v => v.Continue());
});
x.RunAsLocalSystem();
});
what am I missing ?
It is compiling fine. It is not calling any of my methods . I see console flash and disappear. I cant even read what is on that console. If I comment out the line s.WhenContinued(v => v.Continue()); it is working fine
It requires pause to be configured as well. once I added pause method to configuration it started working.
HostFactory.Run(x =>
{
x.SetDescription("Data Service - POC");
x.SetDisplayName("Data Service");
x.SetServiceName("DataService");
x.EnablePauseAndContinue();
x.Service<SampleService>(s =>
{
s.ConstructUsing(() => new SampleService());
s.WhenStarted(v => v.Start());
s.WhenStopped(v => v.Stop());
s.WhenPaused(v => v.AnotherPause());
s.WhenContinued(v => v.Continue());
});
x.RunAsLocalSystem();
});