service - "Service failed to start - Verify that you have sufficient privileges to start system services"

标签 service installation wix

当我尝试运行在WIX中创建的安装程序时,出现以下错误消息:

“服务'Report Generator Service'(报告生成器服务)无法启动。请验证您是否具有启动系统服务的足够特权”。

我已经在这里阅读过一些有关此内容的博客,它们的代码几乎相同,但是仍然不断出现此错误。奇怪的是,当我第一次使用以下几乎相同的代码创建此安装程序时,在安装过程中不会发生此错误。请帮助我迷路的人... :(

<File Id="ReportGenerator.exe"
                                Name="ReportGenerator.exe"
                                Source="..\ReportGenerator\bin\Release\ReportGenerator.exe"
                                KeyPath="yes" />
                          <ServiceInstall Id="ReportGeneratorServiceInstaller"
                                              Name="ReportGeneratorInstaller"
                                              DisplayName="Report Generator Service"
                                              Type="ownProcess"
                                              Start="auto"
                                              ErrorControl="normal"
                                              Description="Generate Reports"
                                              Account="[SERVICEACCOUNT]"
                                              Password="[SERVICEPASSWORD]" />
                          <ServiceControl Id="StartReportService"
                                          Start="install"
                                          Stop="both"
                                          Remove="uninstall"
                                          Name="ReportGeneratorInstaller"
                                          Wait="yes" />

最佳答案

如果您的服务依赖于安装在GAC中的程序集,则将无法使用ServiceControl来启动它。在提交安装之前,GAC的程序集不存在,这对于ServiceControl来说太晚了。

关于service - "Service failed to start - Verify that you have sufficient privileges to start system services",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5697364/

相关文章:

wix - 如何系统地为使用热量收集的文件设置 "ReadOnly"属性?

c# - 将计时器与 Windows 服务一起使用是否明智?

windows - PID在netstat中存在,但在任务管理器中不存在

c# - 如何在Windows服务安装程序中设置 "interact with desktop"

android - 用于将大型(2 GB)文件上传到 android 中的服务器的服务/IntentService

wpf - ClickOnce 安装后立即运行更新程序

c# - 在 .Net 中解压 MSI

WAMP 上的 Magento fatal error : Maximum execution error solution,

wix - 使用 WIX 自动更新应用程序安装程序?

c# - Wix 构建错误