Service never starts only on Windows 2000 Server

E

ERobishaw

A windows service I've created runs on all boxes except Windows 2000
server.

The windows service initializes (i.e., the Service:ServieBase class
gets constructed),
but the OnStart() method never fires.

On the same server, I have another service I've created which runs
just fine. Both services were installed using the Windows Installer,
exactly the same deal... both services run on other machines too.


BTW: when the constructor starts, I log "Service Initializing" at the
top, and "Service Initialized" at the bottom of the constructor, and
both get logged.


BUT THE ONSTART method never fires!


Service status remains forever: "STARTING" I have to kill the
process
to make it go away!


I also am handling AppDomain.CurrentDomain.UnhandledException += ...
but that never fires either.


WORKS on Windows Server 2003, Windows XP, Vista, etc...
DOES NOT WORK in Server 2000.

What gives?
 
M

Misbah Arefin

I found this on another forum; someone had the same problem and came up with
the following solution:

The following service will hang on startup, when run under Windows 2000,
if the OnSessionChange() function is present and enabled. If the
function is commented out, and CanHandleSessionChangeEvent is set to false,
the service starts up correctly.

CanHandleSessionChangeEvent requires full trust for the immediate caller.
This member cannot be used by partially trusted code.

Hope the above helps - I havent tested this cause I dont have a Win2K box
available right now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top