I have a service that I created. The first thing it does is write a line to a text file. It is then suppose to run some functions that are in classes. The service starts then an error box comes up that the service failed stopped and that some services stop when the processing finishes. The main code never even runs and I cannot figure out why.
This is the beginning of the code. It runs.
Here is the next line that never runs.
Protected Overrides Sub OnStart(ByVal args() As String)
' Add code here to start your service. This method should set things
' in motion so your service can do its work.
'Write event to ErrLog.txt
Dim oLog As New System.IO.StreamWriter("C:\MyService\ErrLog.txt", True)
oLog.WriteLine("Service Started - " & Now)
Can you not use classes in a Windows service?
'First get information on the server and create a text file.
Dim clsTemp As New clsServer
Dim clsServers As New List(Of clsServer)
Any thoughts would be appreciated.