2009-08-06 11 views
3

のインストール:は私が使用して書いた最初のサービスをインストールしようとしている.NETのWindowsサービス

installutil XMPPMonitor.exe 

私は、次のメッセージが出ます:

Running a transacted installation. 

Beginning the Install phase of the installation. 
See the contents of the log file for the E:\Documents\Projects\XMPPMonitor\XMPPMonitor\bin\Debug\XMPPMonitor.exe assembly's progress. 
The file is located at E:\Documents\Projects\XMPPMonitor\XMPPMonitor\bin\Debug\XMPPMonitor.InstallLog. 

The Install phase completed successfully, and the Commit phase is beginning. 
See the contents of the log file for the E:\Documents\Projects\XMPPMonitor\XMPPMonitor\bin\Debug\XMPPMonitor.exe assembly's progress. 
The file is located at E:\Documents\Projects\XMPPMonitor\XMPPMonitor\bin\Debug\XMPPMonitor.InstallLog. 

The Commit phase completed successfully. 


The transacted install has completed. 

をしかし、私はリストされたサービスを設定していませんよservices.mscを実行すると何か不足していますか?

答えて

2

ServiceInstallerServiceProcessInstallerを正しく作成して構成してください。これらは、プロセス内で各サービスを実際に登録するためにinstallutilが使用するものです。

1

私たちはコードを見ることができますか?

Description属性には何がありますか?サービスMMCでF5(更新)をクリックしましたか?

public class WindowsServiceInstallerEx : ServiceInstaller 
{ 

    [ComponentModel.Description("A lengthy description of the service that will display in the Description column of the Services MMC applet.")] 
    public string ServiceDescription 
    { 
    get { return serviceDescription; } 
    set { serviceDescription = value; } 
    } 

    public override void Install(System.Collections.IDictionary stateSaver) 
    { 
    base.Install (stateSaver); 

    Microsoft.Win32.RegistryKey serviceKey = null; 
    try 
    { 
     string strKey = string.Format(@"System\CurrentControlSet\Services\{0}", this.ServiceName); 

     serviceKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(strKey, true); 
     serviceKey.SetValue("Description", this.ServiceDescription); 
    } 
    finally 
    { 
     if (serviceKey != null) 
     serviceKey.Close(); 
    } 
    } 

    private string serviceDescription; 
} 
1

services.mscウィンドウを更新する必要がある場合があります。常に開いている場合は更新しない場合があります。 F5キーを押してウィンドウをリフレッシュし、そこにあるかどうかを確認します。

2

私は最近、同様の質問を:C#: Running and Debugging a Windows Service

を私がサービスに添付インストーラを持っていなかったので、どうやら問題でした。

Hereは、私がService Installerなどを追加するのに使ったチュートリアルです。

関連する問題