I have the following declaration of my service:
Yet another reason while this common error will be thrown:
If there is an invalid ServiceConfig
element below the ServiceInstall
element.
Most probably this will apply to any invalid child element of ServiceInstall
.
I had the same problem, it was caused by an earlier version of the service still running on the system. To fix this launch an elevated command line prompt and type:
SC delete NameOfService