Re: Service Problem - service on local computer started and then s
- From: "Robert Jeppesen" <robert<at>durius(dot)com>
- Date: Thu, 17 Nov 2005 03:21:54 +0100
This behaviour is typical for when an exception is thrown on startup. Maybe
there's something wrong with the EventLog.Write call?
Like Kevin said, Try/Catch is a good idea.
--
Robert Jeppesen
Durius
http://www.durius.com/
"Grigs" <Grigs@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9433C395-4AAB-4466-8FD9-B930C12F4586@xxxxxxxxxxxxxxxx
> Kevin, I will try a try-catch block, but as I mentioned, all I am doing is
> an
> EventLog.Write method in the OnStart, OnStop and the timers elapsed event.
> But perhaps there is something going wrong there and will try it.
>
> As for debugging the service, that only works if you can get the service
> started. Lucky me, I can't even get that far.
>
> I just tried it on yet another machine and it works like a champ.
>
> Ugh, more help needed I am afraid. I will post after I do the above.
> --
> Thanx,
> Grigs
>
>
> "Kevin Spencer" wrote:
>
>> You didn't mention anything about exception handling in your service. As
>> a
>> service has no visible user interface, having the service at least write
>> log
>> entries when something goes awry is a good idea. Using try/catch, and
>> handling exceptions well is virtually imperative.
>>
>> If you have Visual Studio.Net, you can also attach to the Service process
>> to
>> debug it.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>> If you push something hard enough,
>> it will fall over.
>> - Fudd's First Law of Opposition
>>
>> "Grigs" <Grigs@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:DE7870A8-4AF8-44CA-857B-014E0998729D@xxxxxxxxxxxxxxxx
>> > Hello,
>> >
>> > I have created Windows Services before using C# and have had no
>> > problems.
>> > Not to mention, the one I currently am having problems with worked
>> > great
>> > for
>> > the first 3 days. Then I added some more SQL code and went to test it
>> > again
>> > and now whenever I start the Service up I get the following error
>> > message...
>> >
>> > The <xxx> service on local computer started and then stopped...
>> >
>> > I tried a few things like removing the new code and such without any
>> > success. I even wound up creating a brand new Project as a Windows
>> > Service
>> > and all this one does at the moment is wait for a timer to elapse in 10
>> > seconds and then it will write an entry to the log file. I also have
>> > it
>> > logging at OnStart and OnStop. None of the logging happens.
>> >
>> > Since there is really no code other than event log stuff in the new
>> > project,
>> > I have to assume it is some other something that is halting my service.
>> > this
>> > is really killing my time and any solution would be Greatly
>> > appreciated.
>> >
>> > Further information:
>> >
>> > I just took the slimed down version of the Windows Service to another
>> > machine. Did the InstallUtil and started it. It started and did the
>> > logging
>> > as expected. I then manually stopped it and all went as it should.
>> >
>> > Nothing my event logs seems to point to anything that is of any use.
>> > The
>> > application log has nothing in it when I attempt to start it. The
>> > System
>> > has
>> > two events (7035 - Successfully sent a start control) then right after
>> > that
>> > is (7036 - entered the stopped state.)
>> >
>> > I tried to run it in Safe Mode but it would not let me start that
>> > service
>> > in
>> > Safe Mode.
>> >
>> > PLEASE help
>> > --
>> > Thanx,
>> > Grigs
>>
>>
>>
.
- Follow-Ups:
- References:
- Prev by Date: Re: Service Problem - service on local computer started and then s
- Next by Date: RE: Catch Exception thrown by spawned Thread.Start in Parent Threa
- Previous by thread: Re: Service Problem - service on local computer started and then s
- Next by thread: Re: Service Problem - service on local computer started and then s
- Index(es):
Relevant Pages
|