J
Jeff Dege
I have a service, written in C# and .NET V2.0.50727, that works fine on
some machines, but hangs on start on others.
In MyService.Main(), I read the registry for a few initialization
settings, most important of which for our purposes is the name of the
logfile.
I then create a new MyService object, and pass it to ServiceBase.Run().
(MyService is, of course, derived from ServiceBase).
I write a log message immediately before ServiceBase.Run(myServiceObject).
MyService.OnStart(args) writes a log message immediately on being called.
On the machines where this works, I see, in the logfile, the two messages
one immediately following the other.
On the machines where it does not, when I try to start the service, the
progress bar seems to stop, half-way, then after a long wait, I get a
failed to start dialog. In the Services Manager, the service displays a
"Starting" status, with the start, restart, and stop buttons greyed out.
If I try to remove the service, the Startup Type in the Services Manager
changes to "Disabled", but MyServicee stays in the list. Nothing short
of a reboot seems to work to get rid of it.
Meanwhile, the logfile shows nothing after ServiceBase.Run(). Either
MyService.OnStart() is not being called, or it's failing to write to the
logfile.
The event viewer shows only an uninformative message: "The MyService
service terminated unexpectedly".
I'm catching and logging all exceptions - none seem to be thrown.
I have no idea what is going on, and have no idea at all as how to figure
out what the problem is.
Since it shows up on one machine, but not on another, my guess would be
that it might be some sort of security or permissions issue. But guesses
aren't of much help. Is there anyway of tracking what is going on? SCM
is running into some sort of problem, where do I look to find out what it
is?
--
Freedom is not empowerment. Empowerment is what the Serbs have in
Bosnia. Anybody can grab a gun and be empowered. It's not entitlement. An
entitlement is what people on welfare get, and how free are they? It's
not an endlessly expanding list of rights - the 'right' to education,
the 'right' to health care, the 'right' to food and housing. That's not
freedom, that's dependency. Those aren't rights, those are the rations
of slavery - hay and a barn for human cattle.
-- P.J. O'Rourke
some machines, but hangs on start on others.
In MyService.Main(), I read the registry for a few initialization
settings, most important of which for our purposes is the name of the
logfile.
I then create a new MyService object, and pass it to ServiceBase.Run().
(MyService is, of course, derived from ServiceBase).
I write a log message immediately before ServiceBase.Run(myServiceObject).
MyService.OnStart(args) writes a log message immediately on being called.
On the machines where this works, I see, in the logfile, the two messages
one immediately following the other.
On the machines where it does not, when I try to start the service, the
progress bar seems to stop, half-way, then after a long wait, I get a
failed to start dialog. In the Services Manager, the service displays a
"Starting" status, with the start, restart, and stop buttons greyed out.
If I try to remove the service, the Startup Type in the Services Manager
changes to "Disabled", but MyServicee stays in the list. Nothing short
of a reboot seems to work to get rid of it.
Meanwhile, the logfile shows nothing after ServiceBase.Run(). Either
MyService.OnStart() is not being called, or it's failing to write to the
logfile.
The event viewer shows only an uninformative message: "The MyService
service terminated unexpectedly".
I'm catching and logging all exceptions - none seem to be thrown.
I have no idea what is going on, and have no idea at all as how to figure
out what the problem is.
Since it shows up on one machine, but not on another, my guess would be
that it might be some sort of security or permissions issue. But guesses
aren't of much help. Is there anyway of tracking what is going on? SCM
is running into some sort of problem, where do I look to find out what it
is?
--
Freedom is not empowerment. Empowerment is what the Serbs have in
Bosnia. Anybody can grab a gun and be empowered. It's not entitlement. An
entitlement is what people on welfare get, and how free are they? It's
not an endlessly expanding list of rights - the 'right' to education,
the 'right' to health care, the 'right' to food and housing. That's not
freedom, that's dependency. Those aren't rights, those are the rations
of slavery - hay and a barn for human cattle.
-- P.J. O'Rourke