>Which same thing? An error message about service not being installed or it starts and then immediately stops? If it's the latter, then you need to have a Console.ReadLine() between the OnStart and OnStop.
The Console.ReadLine() was necessary. I must have missed that one.
>I didn't go back and look at your previous code, but in the code you just posted you're using toWindowsService.OnStart() and toWindowsService.OnStop() ... but those methods are protected, not public. So, what have you done there? (I suppose I'll just go back and look at your previously posted code.) That's why MyService has public Start() and Stop() methods, so that I can call them from the static Main (and they in turn call the .OnStart() and .OnStop()).
As is, presently, when I click on the EXE, I can see that the application runs. It appears on the Task Manager and disappear. So, the Timer doesn't get initiated when I click directly on the EXE. This must be related to the infrastructure you just mentioned.
Presently, the base class is like this:
Protected Shared Sub Startup(toArgs As String(), toWindowsService As WindowsService)
If Not Environment.UserInteractive Then
Run(toWindowsService)
Else
toWindowsService.OnStart(toArgs)
Console.ReadLine()
toWindowsService.OnStop()
End If
End Sub
Protected Overrides Sub OnStart(ByVal toArgs As String())
MyBase.OnStart(toArgs)
So, those methods are protected. But, I'll have to switch a few things in here to adopt your approach to see if that will help.