I have two questions:
First, I was working on debugging a service I had just written and getting really frustrated because nothing I tried seemed to be fixing a relatively simple problem. Eventually I figured out that VB .net hadnt been building new .exe files at all. I tested this by deleting the .exe from the bin folder and rebuilding, and it didnt help. I worked around this by copy-and-pasting the code into a new file. Does anyone know why this happens?
Second, Once I had the service completely running I found that my controller application was having problems with its servicecontroller. If the service was stopped it wouldnt be able to start it and if I tried to stop it again it would give me this error: "Cannot start service service1 on computer '.'"
I had had this error before when I tried to stop the service when it was already stopped so I added this code:
If (ServiceController1.Status =
ServiceProcess.ServiceControllerStatus.Running.Running
Or ServiceController1.Status = ServiceProcess.ServiceControllerStatus.StartPending)
And ServiceController1.CanStop = True Then
ServiceController1.Stop()
End If
First, I was working on debugging a service I had just written and getting really frustrated because nothing I tried seemed to be fixing a relatively simple problem. Eventually I figured out that VB .net hadnt been building new .exe files at all. I tested this by deleting the .exe from the bin folder and rebuilding, and it didnt help. I worked around this by copy-and-pasting the code into a new file. Does anyone know why this happens?
Second, Once I had the service completely running I found that my controller application was having problems with its servicecontroller. If the service was stopped it wouldnt be able to start it and if I tried to stop it again it would give me this error: "Cannot start service service1 on computer '.'"
I had had this error before when I tried to stop the service when it was already stopped so I added this code:
If (ServiceController1.Status =
ServiceProcess.ServiceControllerStatus.Running.Running
Or ServiceController1.Status = ServiceProcess.ServiceControllerStatus.StartPending)
And ServiceController1.CanStop = True Then
ServiceController1.Stop()
End If