c# - Topshelf WhenContinued not working -
topshelf not working when add whencontinued in configuration. working fine start , stop methods. not have code in continue method block 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 missing ?
it compiling fine. not calling of methods . see console flash , disappear. cant read on console. if comment out line s.whencontinued(v => v.continue()); working fine
it requires pause configured well. once added pause method configuration 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(); });
Comments
Post a Comment