c# - Strange Problem with a .NET Windows Service -
I have two Windows services written in C # after the same pattern and method.
Both services were tested against Windows 7 VM and QA which was tested on Windows Server 2008 VM. Both services have been installed and uninstalled under this testing environment many times, however, one of these two services has been refused to launch production environment (Windows Server 2008) .
The use of InstallUtil.exe with ServiceInstaller and ServiceProcessInstaller component is connected to the service.
From all the attendees, the unsuccessful service is established successfully InstallUtil.exe reports success and the service appears in the service snapin. You can locate the service in the registry under HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ Blah Blah. However, if you try to start the service, you receive the following:
Pure start blah.blah.exe "The service name is invalid."
... or service snapin ... "Windows could not start the" Blah Blah "service on the local computer. Error 1053: The service did not respond to the control or initial request from time to time."
I've added some event services that have been logging in to the service class constructor, but it is not visible to call.
Since it is a production box, there is no Visual Studio on the box and the remote debugging is out of the question.
Is there any other way to get debugging information, why the failed service is not starting?
Is there any other obvious reason why I see such a problem?
Edit: I should also mention it. Other evidence of a problem in Windows Event Viewer is two messages in the system log from Service Control Manager:
"Blow Blow Service To connect with, one time has reached (30000 milliseconds).
"Blah Blah service failed to start due to the following error: Service started in the initial control or responded to the control request Do not . "
Edit: Resolved This problem was a combination of a configuration mistake and a bug that was hiding it ended. See mine below for more details. .
Answer to danger: "how
The root cause of this problem is an invalid There was a custom configuration in App.config section, we use a custom configuration section to configure the service from app.config and Nfigreshn assembly derived class and namespace was changed recently.
As it turns out, the definition of our production configuration was looking for the custom configuration thrown in the wrong assembly and when the instant failure failed to hide it by a bug where the service life In the early things was caught, the app will try to log in the custom log instead of the event log. (Since the event log source was not present on the custom event log, this would put another exception to the global exception handler and the service will die in the manufacturer.)
This second exception was not found anywhere, Look through the code inspection.
To fix the configuration and modify the global exception handles, try to write the application on the event log only by using the service name as the event log source. (InstallUtil registers the service name as an application log source on the service log.)
Help Thanks for everyone! Sorry, this particular problem is very specific for our setup.
Comments
Post a Comment