0

I am using VS2019 and i have converted my windows service to .netcore 3.1 and created installer file using WIX. I was able to install the service and while starting the service manualy it works, but when starting automatically after installation getting an error like

Service is failed to start. Verify that you have sufficient privileges to start the system services

My Coponent code is below,

<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" />

I have also given elevated privilages. Is there anything that i need to do or aenter code herenything missing.

arun
  • 21
  • 2
  • Did you run the installer as an administrator? Under which/what type of account are you trying to run the service? – rickvdbosch Jun 03 '20 at 07:54
  • [Here is a link collection on deployment issues](https://stackoverflow.com/questions/25004226/msi-vs-nuget-packages-which-are-is-better-for-continuous-delivery/25005864#25005864). Also, maybe try these service check lists: [Overall](https://stackoverflow.com/a/61149858/129130), [Detailed 1](https://stackoverflow.com/a/53530377/129130), [Detailed 2](https://stackoverflow.com/a/49637913/129130) - what is that authenticated users section? What account runs the service? This sounds like a policy issue or a lacking privilege to deal with services. `LocalSystem` should have all necessary privilege. – Stein Åsmul Jun 03 '20 at 11:35
  • [This was the intended link actually](https://stackoverflow.com/a/55087943/129130). The MSI runs some operations in system context. Your use of that authenticated users construct must cause some side-effect. Try to take it out and see what happens? – Stein Åsmul Jun 03 '20 at 12:02
  • Finally issue is resolved, it is because of the name i given for ServiceInstall and ServiceControl was different. It should be same i have corrected and issue is resolved. – arun Jun 05 '20 at 07:09

0 Answers0