已成功安装Microsoft服务,但在服务列表中未显示



>我需要帮助。 我按照本教程安装微软服务,成功,但我在服务列表中没有看到。

我的服务:

public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
}
protected override void OnStop()
{
}
}

还有其他模式可以安装服务吗?还是我错了?

我从开发人员命令工具的响应:

开始安装的安装阶段。有关 C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.exe 程序集的进度。该文件位于 C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.InstallLog. 安装程序集 'C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.exe'. 受影响的参数包括:logtoconsole = 程序集路径 = C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.exe 日志文件 = C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.InstallLog 没有具有 RunInstallerAttribute.Yes 属性的公共安装程序 可以在 C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.exe 集会。

安装阶段已成功完成,提交阶段为 开始。有关 C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.exe 程序集的进度。该文件位于 C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.InstallLog. 提交程序集 'C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.exe'. 受影响的参数包括:logtoconsole = 程序集路径 = C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.exe 日志文件 = C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.InstallLog 没有具有 RunInstallerAttribute.Yes 属性的公共安装程序 可以在 C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.exe 集会。删除安装状态文件,因为没有安装程序。

提交阶段已成功完成。

事务处理安装已完成。

您跳过了本文中的一个重要步骤:

若要使用本文中的步骤,首先需要将服务安装程序添加到 Windows 服务。请参见演练:在组件设计器中创建 Windows 服务应用程序。

您的服务没有安装程序,因此installutil报告时无需执行任何工作:

找不到具有 RunInstallerAttribute.Yes 属性的公共安装程序

因此,请为服务创建安装程序。

最新更新