问题
I have a Windows Service and Service Installer inside of a .NET class library (not an exe).
Once the service is installed via installutil, when trying to start, I get the error
Windows could not start the xxx service on Local Computer
Error 193: 0xc1
In googling I found that this error might be due to the fact that my service is part of a dll, not an exe. Could this be the problem? If so, how can I resolve the issue? If not, what else could be the problem.
回答1:
In VS.NET go to New Project/Windows/Windows Service, overwrite the service and install classes with your own. Then you can use installutil on the compiled exe file. There is no way you can install a windows service from a .dll
来源:https://stackoverflow.com/questions/5362514/net-windows-service-from-dll