Solved

windows service help

Posted on 2009-04-01
5
283 Views
Last Modified: 2013-12-17
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?

0
Comment
Question by:jb09376
5 Comments
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 24039379
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
 
LVL 7

Accepted Solution

by:
badbearontour earned 50 total points
ID: 24051205
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
 
LVL 11

Expert Comment

by:Mihai Stancescu
ID: 24084313
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
 

Author Comment

by:jb09376
ID: 24162348
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
 
LVL 7

Expert Comment

by:badbearontour
ID: 24192240
great, at least you found it...

BB
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question