Here is the lifecycle of a Windows Service from .Net
--Clicked Start from gui
Main()
Service1() Constructor
InitializeComponent()
OnStart()
--END Clicked Start from gui
--Clicked Restart from gui (looks just like clicking stop and then start)
OnStop()
Dispose()
Main()
Service1() Constructor
InitializeComponent()
OnStart()
--ENDClicked Restart from gui (looks just like clicking stop and then start)
--Clicked Stop from gui
OnStop()
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() Constructor
InitializeComponent()
OnStart()
Dispose()
--END Ran from VS.NET by hitting "Play" button and only calling "(new Service1()).OnStart(args);" from Main().