Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
Here is the lifecycle of a Windows Service from .Net
--Clicked Start from guiMain()Service1() ConstructorInitializeComponent()OnStart()--END Clicked Start from gui
--Clicked Restart from gui (looks just like clicking stop and then start)OnStop()Dispose()Main()Service1() ConstructorInitializeComponent()OnStart()--ENDClicked Restart from gui (looks just like clicking stop and then start)
--Clicked Stop from guiOnStop()Dispose()--END Clicked Stop from gui
--Ran from VS.NET by hitting "Play" button and only calling "(new Service1()).OnStart(args);" from Main().Main()Service1() ConstructorInitializeComponent()OnStart()Dispose()--END Ran from VS.NET by hitting "Play" button and only calling "(new Service1()).OnStart(args);" from Main().
Remember Me