"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/