views:

1190

answers:

2

I created a .NET windows service that installs without any issues on the dev machine. On the server that has only the .NET framework (and no VS installed), since I don't have the VS 2008 prompt, I did the following.

  1. I opened the command prompt
  2. I did cd C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727
  3. I attempted to install the service using installutil.exe "Path to the service .exe"

I get the following exception:

Microsoft (R) .NET Framework Installation utility Version 2.0.50727.1433
Copyright (c) Microsoft Corporation.  All rights reserved.

Exception occurred while initializing the installation:
System.Configuration.ConfigurationErrorsException: 
Configuration system failed to initialize

This service installs/uninstalls without any issues on my local host. Any help?

The service.exe.config looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <!-- Should process conversions -->
    <add key="Service.EnableConversions" value="true"/>
    <!-- Poll Interval-->
    <add key="Service.Interval" value="10000" /> <!-- Set to 10 seconds -->
  </appSettings>
</configuration>
A: 

Not sure why your config should cause any trouble....

Can you try to create and install your service with the sc.exe tool instead? It's part of Windows and should be present on all more recent Windows versions.

Do a sc -? to get the full info about all the parameters.

Basically to create and install the service, you need:

sc create (service name) binPath= (path to your exe) DisplayName= (display name)

Watch for the spaces after the "=" sign! They're needed - without them, it won't work (I know it's odd - but that's the syntax - trust me).

marc_s
Yes, the service.exe.config is the same folder as the service.exe
+2  A: 

It was an issue with a corrupt machine.config on the server. After reinstalling it this issue was resolved.