Hello listers, I'm having trouble getting a Windows Service to run 'properly'.
My goal for this sample project was to create a service that would just post a
message to system debug every 30 seconds. My problem is that when I manually
start my service I get the following message
"The sampleService service on Local Computer started and then stopped. Some
services stop automatically if they are not in use by other services or
programs"
To create the service I made a new project (RS Studio 2010r2) and selected
'Empty Service' for the template. I then added a new class to the Project
named 'srvcTimer' and set the super to Timer. Here's all the code…
App.Run()
dim checkTimer as srvcTimer
checkTimer = new srvcTimer
checkTimer.Period = 30000
checkTimer.Mode = 2
srvcTimer.Action()
System.DebugLog("Timer event fired")
After building the app I added it as a service using the following command in
Windows 7
sc create sampleService binPath= c:\path\to\sampleService.exe type= own
This seemed to create the service properly (it shows up in the Services
Controller), but when I start it I get the message I listed above.
Does anyone tell me what I am doing wrong? Thanks!
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|