473,386 Members | 1,867 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,386 software developers and data experts.

Windows Service not starting

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
5 4697

"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

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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Laszlo Zsolt Nagy | last post by:
Sorry, I realized that the import zlib was not executed from my (working) service. So here is the question: why can't I use zlib from a win32 service? Is there any way to make it working? ...
2
by: Razzie | last post by:
Hey all, I wrote a Windows Service. When I test it on my developement machine (winXP) it works fine. It starts ok, never crashes, etc. When I install the service on another machine (win2000) it...
9
by: SP | last post by:
Hi All, I wrote a windows service which is supposed to stop after specified amount of time. I am calling OnStop() after specified time. OnStop() methods executed but I dont see the service...
0
by: tshad | last post by:
I have a Windows Service I created that just sets a timer and writes to EventLog every 10 seconds. It installed fine and it actually starts. But it says it doesn't. The progress bar shows the...
6
by: Joe | last post by:
C# .NET 2.0 I've got a Windows Service that works exactly as I expect it to. However, it does rely on a few Configuration settings. If the customer doesn't configure it correctly, the service...
1
by: =?Utf-8?B?cm9zczYxMw==?= | last post by:
I'm puzzled by an error message encountered while creating a Windows Service. In particular, I'm creating a second Windows Service within a Windows Service project, using Visual Studio 2005. The...
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
4
by: =?Utf-8?B?am1hZ2FyYW0=?= | last post by:
I've written a .net Windows service in C#. It works most of the time for most people. It is configured to automatically start when Windows boots. Sometimes it fails to start on Windows XP during...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.