2010-01-02 45 views
2

我創建了一個.NET Windows服務,如果沒有開發機上的任何問題進行安裝。在只有.NET框架(並且沒有安裝VS)的服務器上,因爲我沒有VS 2008提示符,所以我做了以下操作。配置系統初始化失敗 - Windows服務.NET

  1. 我打開命令提示符
  2. 我做cd C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727
  3. 我試圖使用installutil.exe 「的路徑服務.EXE」 安裝服務

我得到以下異常:

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 

該服務沒有安裝在我的本地主機上的任何問題/卸載。任何幫助?

的service.exe.config看起來是這樣的:

<?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> 

回答

4

這是與服務器上的腐敗machine.config中的問題。重新安裝後,此問題已解決。

0

不知道爲什麼你的配置應該引起任何麻煩....

可以嘗試創建並與sc.exe安裝服務工具呢?它是Windows的一部分,應該出現在所有更新的Windows版本上。

做一個sc -?,以獲取有關的所有參數的完整信息。

基本上創建和安裝的服務,您需要:

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

手錶之後, 「=」 簽署空間!他們是需要的 - 沒有他們,這是行不通的(我知道這很奇怪 - 但這是語法 - 相信我)。

+0

是的,service.exe.config是相同的文件夾service.exe – Nick 2010-01-02 14:49:38

相關問題