473,321 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Yoyo Services

Hi,
I've been trying to create a windows service that handles some system
events, but when I try to start it stops immediately; it yoyos. I read
somewhere that even a the service template should keep running but I built a
copy of it and it too yoyoed. I've tried putting infinite Thread.Sleep loops
in the Main method but they don't work. Is there something that I've
forgotten to put in my code? I feel like I've tried everything!

From,
Reuben
Oct 2 '05 #1
3 1365

"Reuben" <Re****@discussions.microsoft.com> wrote in message
news:FD**********************************@microsof t.com...
Hi,
I've been trying to create a windows service that handles some system
events, but when I try to start it stops immediately; it yoyos. I read
somewhere that even a the service template should keep running but I built
a
copy of it and it too yoyoed. I've tried putting infinite Thread.Sleep
loops
in the Main method but they don't work. Is there something that I've
forgotten to put in my code? I feel like I've tried everything!


Built a copy of what? The template or your service?

First thing, check your event log and see if there is any mention of why the
service is stopping. Then add logging to your service to see where its
stopping. If you can narrow it down to where the problem is it'll be much
easier to fix.
Oct 2 '05 #2
Thanks. I've found out that an exception occurs in the OnStart function when
I try to hook up my event handler to
Microsoft.Win32.SystemEvents.SessionEnding. Problem s, I don't understand it.
Do you (see below).
Thanks for your help.
Reuben.
================================================== ===
Event Type: Error
Event Source: Symbiosis
Event Category: None
Event ID: 0
Date: 30/09/2005
Time: 5:04:31 PM
User: N/A
Computer: MAIN
Description:
The description for Event ID ( 0 ) in Source ( Symbiosis ) cannot be found.
The local computer may not have the necessary registry information or message
DLL files to display messages from a remote computer. You may be able to use
the /AUXSOURCE= flag to retrieve this description; see Help and Support for
details. The following information is part of the event: Service cannot be
started. System.Runtime.InteropServices.ExternalException: Failed to create
system events window thread.
at Microsoft.Win32.SystemEvents.EnsureSystemEvents(Bo olean requireHandle,
Boolean throwOnRefusal)
at
Microsoft.Win32.SystemEvents.add_SessionEnding(Ses sionEndingEventHandler
value)
at Symbiosis.Symbiosis.OnStart(String[] args)
at System.ServiceProcess.ServiceBase.ServiceQueuedMai nCallback(Object
state).

Oct 3 '05 #3


"Reuben" wrote:
Thanks. I've found out that an exception occurs in the OnStart function when
I try to hook up my event handler to
Microsoft.Win32.SystemEvents.SessionEnding. Problem s, I don't understand it.
Do you (see below).
Thanks for your help.
Reuben.
================================================== ===
Event Type: Error
Event Source: Symbiosis
Event Category: None
Event ID: 0
Date: 30/09/2005
Time: 5:04:31 PM
User: N/A
Computer: MAIN
Description:
The description for Event ID ( 0 ) in Source ( Symbiosis ) cannot be found.
The local computer may not have the necessary registry information or message
DLL files to display messages from a remote computer. You may be able to use
the /AUXSOURCE= flag to retrieve this description; see Help and Support for
details. The following information is part of the event: Service cannot be
started. System.Runtime.InteropServices.ExternalException: Failed to create
system events window thread.
at Microsoft.Win32.SystemEvents.EnsureSystemEvents(Bo olean requireHandle,
Boolean throwOnRefusal)
at
Microsoft.Win32.SystemEvents.add_SessionEnding(Ses sionEndingEventHandler
value)
at Symbiosis.Symbiosis.OnStart(String[] args)
at System.ServiceProcess.ServiceBase.ServiceQueuedMai nCallback(Object
state).


Reuben,
Try running your service under a Username/Password account and not the
System account. Start from there.
Francisco
Oct 3 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: rbt | last post by:
How does one associate a "Description" with a Windows service written in Python? I've just started experimenting with Python services. Here's my code... copied straight from Mr. Hammond's "Python...
6
by: cs | last post by:
I noticed there is some .net services on my winxp. One or two mention the CLR. Does that mean that my .net apps/services wont run before those services start? I need to run my service as early on...
0
by: Diego F. | last post by:
I've been days with that. I'm trying to work with web services sending and returning objects, and the web service must store some objects. - My first try (the most obvious in my opinion) was to use...
26
by: Mr Newbie | last post by:
What do I need to run a web service on my PC ? I know I need the .NET Framework, but do I need IIS Running ?
3
by: Matt D | last post by:
I've got two web services that use the same data types and that clients will have to consume. I read the msdn article on sharing types...
7
by: Stu | last post by:
Hi, I have a web service which returns a record set and works well integrated with an asp dot net page. However if I decided to develop a unix app will i be able to read the dataset as it is...
1
by: Robert Strickland | last post by:
We are developing a several web applications that use 'services' that perform key business functions for our applications. These same 'services' are avaible to paying clients through web services. ...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
2
by: sdstraub | last post by:
I have created 5 services in my project, in the 1st service I set servicestorun = array of all 5 services, I have a project installer with 5 service installers, one for each service. I have code...
0
by: krishnaraju | last post by:
HI to all, please help me.its urgent requirement. my question is this is the wsdl file i got from our client.please see at bottom. when iam trying to access that webmethods iam getting...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.