您的位置:首页 > 编程语言 > C#

c# 系统服务更改服务名称及部署注意事项

2014-04-01 17:23 567 查看
更改名称:ProjectInstaller.Designer.cs文件的

/// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.TCPMessageProcessorProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
            this.TCPMessageProcessorInstaller = new System.ServiceProcess.ServiceInstaller();
            // 
            // TCPMessageProcessorProcessInstaller
            // 
            this.TCPMessageProcessorProcessInstaller.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
            this.TCPMessageProcessorProcessInstaller.Password = null;
            this.TCPMessageProcessorProcessInstaller.Username = null;
            // 
            // TCPMessageProcessorInstaller
            // 
            this.TCPMessageProcessorInstaller.Description = "程序描述";//程序的描述
            this.TCPMessageProcessorInstaller.DisplayName = "tcprecserver";//在系统管理界面显示的服务名称
            this.TCPMessageProcessorInstaller.ServiceName = "tcprecserver";//注册系统服务时使用的名称
            this.TCPMessageProcessorInstaller.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
            // 
            // ProjectInstaller
            // 
            this.Installers.AddRange(new System.Configuration.Install.Installer[] {
            this.TCPMessageProcessorInstaller,
            this.TCPMessageProcessorProcessInstaller});

        }


部署系统服务,必须是release文件,debug文件部署会失败
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: