windows service help

I'm developing a windows service that will be used as a file import utility.  If I install the service under a local user account and use my network credentials, the service fires up and runs fine.  but if I try to run it under the Local System account, I get the generic error:

The XXXXX service on local computer started and then stopped.  Some services stop automatically if they are not in use by other services or programs.

Any ideas on what would cause this?  Am I missing a setting somewhere?

jb09376Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
badbearontourConnect With a Mentor Commented:
we had the same problem and it is indeed user credentials issue, the system account has no access to the file system.
from memory we used the networkService accoutn on the machine and gave that user account access to the resources, that did the trick.
We have also in the past created a new user account in the domain and given that access to the resources, then set the login details of the service to that user account. We also checked the interact with desktop box, if the service popped any warnings

BB
0
 
Anurag ThakurTechnical ManagerCommented:
are you trying to access some foldes and write to those folders etc?
you are getting some kind of exception - most likely user access issues and i will recommedn you to log the exception and in case its user permission then you might have to use your netowk credientials to run the application
0
 
Mihai StancescuSoftware Engineer Commented:
Try to check the Event Log after receiving that message box, and see the error a bit more clearly.


Hope this helps!


Regards,
Mishu
0
 
jb09376Author Commented:
correct badbear.  I found parts of the code referencing the HKEY_LOCAL_USERS part of the registry, which the system account does not have access to.
0
 
badbearontourCommented:
great, at least you found it...

BB
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.