Error 1001 when installing custom Windows Service

前端 未结 8 592
误落风尘
误落风尘 2020-12-08 15:50

I wrote a windows service that runs on Framework 4.0 and running in VS 2015. I also created a setup project (free Installshield version).

My service did not show und

相关标签:
8条回答
  • 2020-12-08 16:26

    I found something to get rid of the problem, but it does create a new question, albeit a much simpler and less critical one.

    What caused my problem is that I had to remove the following code from my ServiceInstaller's AfterInstall:

    new ServiceController(ServiceInstaller.ServiceName).Start();
    

    This was added to auto start my service once it has been installed. For now I will just manually start the service.

    0 讨论(0)
  • 2020-12-08 16:27

    I am using VS 2012 with InstallShield LE 2015 targeting .NET 4.5 and I have to uncheck the "Installer class" for it to work.

    0 讨论(0)
提交回复
热议问题