【发布时间】:2012-07-05 15:16:15
【问题描述】:
我完全是开发 Windows 服务的菜鸟,我找到了有关实现标准 Windows 服务的教程。这是我找到的代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Configuration.Install;
using System.ServiceProcess;
namespace ReviewsSvc
{
[RunInstaller(true)]
public class ReviewsSvcInstaller
{
private ServiceProcessInstaller processInstaller;
private ServiceInstaller serviceInstaller;
public ReviewsSvcInstaller()
{
processInstaller = new ServiceProcessInstaller();
serviceInstaller = new ServiceInstaller();
processInstaller.Account = ServiceAccount.LocalSystem;
serviceInstaller.StartType = ServiceStartMode.Manual;
serviceInstaller.ServiceName = "Reviews Updater";
Installers.Add(serviceInstaller);
Installers.Add(processInstaller);
}
}
}
我已经添加了必要的参考资料,但我仍然收到关于“未找到安装程序”的错误消息。我错过了什么?
【问题讨论】:
-
这个问题有什么地方太本地化了?
标签: c# windows-services installation