views:

26

answers:

2

I am trying to determine why a .Net service that I can successfully install on a wide number of machines won't start on certain machines.

When the service is started on these machines the service instantly stops, so my assumptions are either that the users doesn't have sufficient privileges to install the service or that there is an issue with the service; however, both of these conditions are false (the service works and they have sufficient privileges).

What are some steps I should take to determine the reason the service won't start?

Edit

I figured out what was wrong thanks to some provided answers, see my answer for what my solution was.

+3  A: 

The Application event log should contain details of any .Net exceptions that occurred during service startup. This may help diagnose the problem.

Alternatively, you can add some debug code (or trace code) to your application startup and use debugview from Sysinternals to see where it gets to.

Matthew Steeples
Service messages are stored in the System log.
Ben M
You guys led me to the correct answer thanks
msarchet
+1: You can also attach a debugger to the service and step through it.
SnOrfus
@Ben M: while you're right that service messages are stored in the event log, .net exceptions get saved to the application log
Matthew Steeples
A: 

So I figured this out, thanks to looking at the event log from @Matthew Steeples and @Ben M.

The issue was the service writes to the event log on start when it connects up to a server; however, this machines event log was full, so when the service tried to write to the event log it failed, causing it to throw an exception which again couldn't be written to the full event log.

So case in point, if you are writing to the event log make sure it isn't full or that you are handling the exception!

msarchet
Hi msarchet, StackOverflow follows a QA format as opposed to a forum format. If an answer provided was sufficient, it's best to mark it as accepted - the poster will appreciate the reputation points. Likewise, adding an answer to your own question in order to continue the conversation is discouraged in favour of editing the original question and adding any solution you found on your own.
SnOrfus
I would add, it's acceptable (pardon the pun) to add and accept your own answer only if there is no other answer that helped you with th eproblem.
Mystere Man
Actually this is an acceptable practice, the provided answers were not actually correct, yes they pointed me towards the answer, but not the actual answer.Meta Posts:http://meta.stackoverflow.com/questions/14488/if-i-find-out-my-answer-why-do-i-have-to-wait-2-days-to-accept-it-closedhttp://meta.stackoverflow.com/questions/2800/should-i-ask-questions-i-already-know-the-answer-to-and-answer-them-myselfhttp://meta.stackoverflow.com/questions/12513/stack-overflow-should-i-answer-my-own-question-or-not
msarchet