I followed an example that updates a textfile every 10 seconds. It is working. But here is the code:
HostFactory.Run(Sub(configurator)
configurator.Service(Of TimedNotifier)(Sub(service)
service.ConstructUsing(Function(factory)
Return New TimedNotifier
End Function)
service.WhenStarted(Function(notifier, hostControl) As Boolean
Return notifier.Start(hostControl)
End Function)
service.WhenStopped(Function(notifier, hostControl) As Boolean
Return notifier.Stop(hostControl)
End Function)
End Sub)
configurator.RunAsLocalSystem()
configurator.SetDisplayName("Sample Service: Timed Notifier")
configurator.SetDescription("This sample service will notify you of the " & _
"current time every 10 seconds.")
configurator.SetServiceName("TimedNotifier")
End Sub)
I see TimedNotifier in the taskmgr but not in the services.msc Dont know if it had to do with RunAsLocalSystem or not. Maybe I cant see services because I am logged in as a admin but not the local admin?