For Programmers: Free Programming Magazines  


Home > Archive > Visual Studio > January 2006 > Windows Service Project Dependencies?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Windows Service Project Dependencies?
Stephen Cuppett

2006-01-28, 9:57 pm

I have written a Windows service in J# and a setup wizard to go with it;
however, I have one problem....

My Windows service creates it's own Event Log and writes events to it.
However, some testing has revealed the service will fail to
automatically start on boot and I have narrowed it down to the situation
wherein the Event Logger isn't started prior to Windows attempting to start
my service. I have worked around the problem by having my service query
whether it is started and starting it itself:

if (eventLogController.get_Status() == ServiceControllerStatus.Stopped)

{

eventLogController.Start();

}

Even though the solution fixes the problem, I don't like it. I know there's
got to be a way to have the dependency listed. I found some mention in MSDN
to a control block that would have a list of dependency names, but that
doesn't seem to correlate to anything I can see in the J# project.

I can't find a way in the service or the setup project associated with it to
list Eventlogger as a dependency so that Windows will start it first. I was
wondering if anyone knew how to build my setup project or alter the service
properties in the VS2005 IDE such that when the service is installed, the
dependency is listed and honored appropriately.

Thanks,

Stephen Cuppett


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com