首页 > 解决方案 > 服务启动失败。验证您是否有足够的权限来启动系统服务

问题描述

我正在使用 VS2019,我已将我的 Windows 服务转换为 .netcore 3.1,并使用 WIX 创建了安装程序文件。我能够安装该服务,并且在手动启动该服务时它可以工作,但是在安装后自动启动时出现类似错误

服务启动失败。验证您是否有足够的权限来启动系统服务

我的 Coponent 代码如下,

<ServiceInstall
              Id="ServiceInstaller"
              Type="ownProcess"
              Vital="yes"
              Name="Django_DRAProcessorServiceTest"
              DisplayName="Django_DRAProcessorServiceTest"
              Description="Django_DRAProcessorServiceTest"
              Start="auto"
              Interactive="no"
              ErrorControl="normal" >

          <util:PermissionEx User="Authenticated Users"
              ServiceStart="yes"
              ServiceStop="yes"
              ServicePauseContinue="yes"
              ServiceInterrogate="yes"
              ServiceChangeConfig="yes"
              ServiceEnumerateDependents="yes"
              ServiceQueryConfig="yes"
              ServiceQueryStatus="yes"
              ServiceUserDefinedControl="yes" />
          <util:ServiceConfig FirstFailureActionType="restart"  SecondFailureActionType="restart" ThirdFailureActionType="restart" />
        </ServiceInstall>      
      <ServiceControl Id="Django_DRAProcessorService_Start"
            Name="Django_DRAProcessorService"
            Start="install"
            Wait="no" />        
            <ServiceControl Id="Django_DRAProcessorService_Stop"
            Name="Django_DRAProcessorService"
            Stop="uninstall"
            Remove="uninstall"`enter code here`
            Wait="yes" />

我也给予了更高的特权。有什么我需要做的或enter code here缺少什么。

标签: .net-corewix

解决方案


推荐阅读