I have created a windows service state that it now no work to do

Joined
Dec 28, 2004
Messages
7
Programming Experience
5-10
The service runs in the VS2005 environment but dies as a service on the target machine. I have a timer (See code below:)
It runs though the new code an then stops.

VB.NET:
  Public Sub New()

    MyBase.New()
    ' This call is required by the Component Designer.
    InitializeComponent()
    On Error Resume Next
    value = RunInstallerAttribute.Yes
    ServiceName = "AdDeskRouter"
    RegistryFunc.ReadRegistry("Software\CNI\AdDeskRouter", "DebugDir", ErrorPath)
    If ErrorPath = "" Then
      ErrorPath = "C:\AdDeskSW\Logs\AdDeskRouter"
    End If
    DirectoryOK = CheckDir(ErrorPath)
    RegistryFunc.ReadRegistry("Software\CNI\AdDeskRouter", "MaxLogSize", MaxLogSize)
    If MaxLogSize = 0 Then MaxLogSize = 1000
    If Not DirectoryOK Then
      Call DebugOut("NEW", 1, " Exiting Load Error Unable to see or create " & ErrorPath)
      Exit Sub
    End If
    Call ReadAll()
    CanPauseAndContinue = True
    AdAlarm = New Timer
    AdAlarm.Interval = 60000
    AddHandler AdAlarm.Elapsed, AddressOf OnAlarm
    AdAlarm.Enabled = True
    Call DebugOut("NEW", 1, " Exit New")
  End Sub
  Protected Sub OnAlarm(ByVal source As Object, ByVal e As ElapsedEventArgs)
    Call DebugOut("OnAlarm", 1, " Alarm Sounded")
    AdAlarm.Enabled = False
    Call ProcessHotFolders()
    AdAlarm.Enabled = True
  End Sub
 
Back
Top