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.
Can you not use classes in a Windows service?
Any thoughts would be appreciated.
Ty
This is the beginning of the code. It runs.
VB.NET:
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)
oLog.Close()
Here is the next line that never runs.
VB.NET:
'First get information on the server and create a text file.
Dim clsTemp As New clsServer
Dim clsServers As New List(Of clsServer)
Can you not use classes in a Windows service?
Any thoughts would be appreciated.
Ty