By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,143 Members | 855 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,143 IT Pros & Developers. It's quick & easy.

Windows Service not starting

P: n/a
Hi

I have created a Windows Service using C# and .NET2.0. The service is
quite simple - right now it doesn't do anything except throwing an
exception in the OnStart method. It used to something more, but I
couldn't get it working, so I boiled it down to the exception to test.

Anyway, the service can be installed using InstalUtil but when
starting the service, I just get the message that the service stopped
again withour reporting any errors.

The code for the web service can be found at
http://www.eliasen.dk/files/MSMQ_Listener_Service.zip

I hope someone can help me troubleshoot this issue?

Thanks in advance!

--
eliasen

Aug 6 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a

"eliasen" <el*******@gmail.comschrieb im Newsbeitrag
news:11**********************@b79g2000hse.googlegr oups.com...
Hi

I have created a Windows Service using C# and .NET2.0. The service is
quite simple - right now it doesn't do anything except throwing an
exception in the OnStart method. It used to something more, but I
couldn't get it working, so I boiled it down to the exception to test.

Anyway, the service can be installed using InstalUtil but when
starting the service, I just get the message that the service stopped
again withour reporting any errors.

The code for the web service can be found at
http://www.eliasen.dk/files/MSMQ_Listener_Service.zip

I hope someone can help me troubleshoot this issue?

Thanks in advance!

--
eliasen
Hi Eliasen,

please check your event logs for more information.
This behaviour can also come to day when you
have two or more versions of the .NET Framework
and InstallUtil on your system. You must use the
InstallUtil that comes with the same .NET FW SDK
as the compiler you have run to compie your service.
Once i had the same

But first check the eventlogs of windows,....
Your code seem to be clean...s

Beste Grüsse / Best regards / Votre bien devoue

Kerem Gümrükcü
ke*****@pro-it-education.de
Pro-IT Education http://www.pro-it-education.de/
Professional IT-Training and Consulting
-----------------------
"This reply is provided as is, without warranty express or implied."


Aug 6 '07 #2

P: n/a

"eliasen" <el*******@gmail.comwrote in message
news:11**********************@b79g2000hse.googlegr oups.com...
Hi

I have created a Windows Service using C# and .NET2.0. The service is
quite simple - right now it doesn't do anything except throwing an
exception in the OnStart method. It used to something more, but I
couldn't get it working, so I boiled it down to the exception to test.

Anyway, the service can be installed using InstalUtil but when
starting the service, I just get the message that the service stopped
again withour reporting any errors.

The code for the web service can be found at
http://www.eliasen.dk/files/MSMQ_Listener_Service.zip

I hope someone can help me troubleshoot this issue?
What you might have to do is enable the Windows Messenger service.

That way, you can put Netsend commands pointing to the local machine-name in
areas of code and send messages to yourself to tell you where you're at in
the code on the Onstart when it aborts. A pop-up screen will show with the
message where you have to press the OK button, after seeing the message,
with using the Netsend command.

You also may want to put Try/Catch around the entire Onstart code and log so
that you can catch the error and send the messages to an Eventlog. I can't
see your code as I don't have WinZip.
Aug 6 '07 #3

P: n/a
On Aug 6, 11:57 am, eliasen <eliase...@gmail.comwrote:
Anyway, the service can be installed using InstalUtil but when
starting the service, I just get the message that the service stopped
again withour reporting any errors.
I hope someone can help me troubleshoot this issue?
Well, well... Thanks for your answers! It turned out that the issue
was actually that the Application eventlog was full. Upon start of the
service, no entries could be put inside the eventlog making the
program crash. I did have a try-catch around the whole thing to test
at first, but in my catch, I wrote to the eventlog :-p - do you see
the loop? :-)

Anyway, I changed the properties of the application log to just delete
as necessary and increased the size a bit.

Thanks!

--
eliasen

Aug 6 '07 #4

P: n/a
Mr. Arnold wrote:
>
"eliasen" <el*******@gmail.comwrote in message
news:11**********************@b79g2000hse.googlegr oups.com...
>Hi

I have created a Windows Service using C# and .NET2.0. The service is
quite simple - right now it doesn't do anything except throwing an
exception in the OnStart method. It used to something more, but I
couldn't get it working, so I boiled it down to the exception to test.

Anyway, the service can be installed using InstalUtil but when
starting the service, I just get the message that the service stopped
again withour reporting any errors.

The code for the web service can be found at
http://www.eliasen.dk/files/MSMQ_Listener_Service.zip

I hope someone can help me troubleshoot this issue?

What you might have to do is enable the Windows Messenger service.

That way, you can put Netsend commands pointing to the local
machine-name in areas of code and send messages to yourself to tell you
where you're at in the code on the Onstart when it aborts. A pop-up
screen will show with the message where you have to press the OK button,
after seeing the message, with using the Netsend command.
I really liked that idea. But trying to add it to the error handling for
my services it turns out that NET SEND (really the Win32
NetMessageBufferSend function) is no longer supported starting with
Vista. Bummer. I know that the messenger service had its issues, but
this would have been a neat way to augment other service debugging
techniques.

--
-glenn-
Aug 6 '07 #5

P: n/a

"GlennDoten" <gd****@gmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Mr. Arnold wrote:
>>
"eliasen" <el*******@gmail.comwrote in message
news:11**********************@b79g2000hse.googleg roups.com...
>>Hi

I have created a Windows Service using C# and .NET2.0. The service is
quite simple - right now it doesn't do anything except throwing an
exception in the OnStart method. It used to something more, but I
couldn't get it working, so I boiled it down to the exception to test.

Anyway, the service can be installed using InstalUtil but when
starting the service, I just get the message that the service stopped
again withour reporting any errors.

The code for the web service can be found at
http://www.eliasen.dk/files/MSMQ_Listener_Service.zip

I hope someone can help me troubleshoot this issue?

What you might have to do is enable the Windows Messenger service.

That way, you can put Netsend commands pointing to the local machine-name
in areas of code and send messages to yourself to tell you where you're
at in the code on the Onstart when it aborts. A pop-up screen will show
with the message where you have to press the OK button, after seeing the
message, with using the Netsend command.

I really liked that idea. But trying to add it to the error handling for
my services it turns out that NET SEND (really the Win32
NetMessageBufferSend function) is no longer supported starting with Vista.
Bummer. I know that the messenger service had its issues, but this would
have been a neat way to augment other service debugging techniques.
Yes, I used Netsend to debug the Onstart and in other areas, like debugging
a Dll that the service was using. I liked it in the Dll very much in
debugging, because otherwise, one would have to put in code to start dumping
messages into the eventlog or to a text file to see what was going on.

It got tiresome having to go to the eventlog or to a text file and look at
messages dumped into the them to debug a service, and I started using the
Netsend. It works beautifully I might add too. :)

I also use one common Eventlog routine and pass any messages to the routine.
If I have an error with the Eventlog, like the log is full, then I would use
Netsend to send an error for the Eventlog, along with popping a message on
the error that was sent the Eventlog routine. Of course, I would have a
counter to stop using the Netsend after so many messages were sent to stop
it from sending to many messages that had to be replied to. :)

I didn't know that Netsend and the Messenger Service are removed from Vista.
I just looked on my Vista machine.

However, you might be able to use what's in the link. It might be away to
skin the cat, anyway.

http://www.lantalk.net/netsend/

Aug 6 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.