当我尝试运行我在WIX中创建的安装程序时,出现以下错误消息:
“服务'报告生成器服务'(报告生成器服务)无法启动。验证您是否具有足够的权限来启动系统服务”。
我已经在这里阅读了一些博客,我的代码几乎完全相同,但仍然会出现这个错误。关于这一点的奇怪之处在于,当我第一次使用与下面几乎相同的代码创建此安装程序时,在安装期间不会发生此错误。请帮帮我们,我迷路了...... :(
<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" />
答案 0 :(得分:7)
如果您的服务依赖于安装到GAC中的程序集,您将无法使用ServiceControl启动它。在提交安装之前,GAC的程序集不存在,这对ServiceControl来说太晚了。
答案 1 :(得分:2)
如果服务帐户没有“作为服务登录”权限,也会发生此错误。解决这个问题
我在这里提到这一点是因为Google搜索上述错误会在第一页中列出此链接。 :)有人可能会发现这个有用的