|
-
Feb 16th, 2004, 03:18 PM
#1
Thread Starter
New Member
VB.NET service always in "starting" mode
Hi everyone-
I am trying to write a fairly simple VB.NET service (use a timer to poll a network location for a file, if file exists, send message).
The service correctly start, stops, runs the timer, etc. I can tell this from a custom event log I created, and it adds new entries on start, stop, and each time the timer expires.
FYI...since this is my first service to write, I'm going by a MSDN article I found on the subject.
OK, back to topic...when I try to start my service (My Computer --> Manage --> Services & Applications --> Services --> Right-click my service and click "Start"), the progress bar window that appears never completely finishes. I loads the first 50% or so just fine, then does the rest VERY slowly, and never closes. However, if I click "Close", my service status says "Starting", but it is writing entries to the event log as the timer expires, so it is running.
Is there something in my code I'm doing wrong that makes it think it never finished loading the service (although it did)?
Thanks in advance-
Code:
Protected Overrides Sub OnStart(ByVal args() As String)
logMain.WriteEntry("Service started.", EventLogEntryType.Information)
' Setup timer
timeQuery.AutoReset = True
' Set for testing. Increase time for deployment.
timeQuery.Interval = 6000
' Start timer
timeQuery.Start()
End Sub
-
Feb 16th, 2004, 05:37 PM
#2
Addicted Member
Have you tried running the debugger on your service and stepping thru it?
Tools, Debug Process, select the service, and click attach iirc.
-
Feb 17th, 2004, 11:03 AM
#3
Thread Starter
New Member
I reduced my code to only enter an event in the log, and it still hangs up when starting.
I can click the "Close" button once it appears to hang and the status shows "Starting", but I can view the event log and see the entry from the OnStart code.
I've tried starting the service then attaching the debugger, but nothing comes up (nothing happening?).
Wierd...
VB Code:
Protected Overrides Sub OnStart(ByVal args() As String)
logMain.WriteEntry("Web TrackIt Alerts", "Service started.", EventLogEntryType.Information, 0)
' Start timer
'timeQuery.Enabled = True
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|