2016-10-11 25 views
1

現在、サービスとして正しくインストールするためのプログラムがありますが、スタートアップの種類は「手動」に設定されています。このアプリケーションをStartup Type = Automaticに設定するにはどうすればよいですか?C#サービスのインストールと起動時の自動起動の設定

​​3210

そしてJMSは、次のとおりです。

namespace JMS { 
partial class DocLogicJMS { 
    /// <summary> 
    /// Required designer variable. 
    /// </summary> 
    private System.ComponentModel.IContainer components = null; 

    /// <summary> 
    /// Clean up any resources being used. 
    /// </summary> 
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> 
    protected override void Dispose(bool disposing) { 
     if (disposing && (components != null)) { 
      components.Dispose(); 
     } 
     base.Dispose(disposing); 
    } 

    #region Component Designer generated code 

    /// <summary> 
    /// Required method for Designer support - do not modify 
    /// the contents of this method with the code editor. 
    /// </summary> 
    private void InitializeComponent() { 
     this.ServiceName = "DocLogic JMS"; 
    } 

    #endregion 
} 

}この質問はすでにここに回答されているようだ

答えて

0

: これが最もupvoted答えのようですHow do I change a Windows Service's startup type in .NET (post-install)?

var svc = new ServiceController("ServiceNameGoesHere"); 
ServiceHelper.ChangeStartMode(svc, ServiceStartMode.Automatic); 
+0

私の問題についての詳細を追加しました。私はこれが私が必要とするものに近いが、正確ではないと思う。 –

+0

しかし、あなたは私を正しい軌道に乗せました。ありがとうございました。私はこれらの行に必要な:this.JMSserviceInstaller.StartType = ServiceStartMode.Automatic; this.JMSserviceInstaller.DelayedAutoStart = false; –

関連する問題