【发布时间】:2021-01-14 12:48:50
【问题描述】:
我目前正在开发一个名为 PrintWatcher 的 Windows 服务。此名称也在 serviceInstaller 属性窗口中设置。该服务工作正常,名称正确显示在任务管理器的“服务”选项卡中。 但是,在 ServiceClass Designer 中,我发现了以下内容:
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
this.ServiceName = "Service1";
}
将“Service1”分配给 this.ServiceName 对服务有什么影响?该名称没有显示,但不建议手动修改它,如上面的摘要中所述。 还应该在哪里设置名称?
【问题讨论】:
-
有更新吗?请检查我的回答是否对您有帮助。
标签: c# visual-studio windows-services