我有一个用 c# 编写的自定义 Windows 服务,我需要安装和调试它。当我使用
installutil "[path].exe"
从命令行然后尝试搜索该服务,它不会出现在任何地方的已安装服务列表中。查看安装日志文件,我看到:
Installing assembly 'myservice'.
Affected parameters are:
logtoconsole =
assemblypath = mypath
logfile = mylogfile
Installing service MyService
Service MyService has been successfully installed.
Creating EventLog source MyService in log Application...
Committing assembly 'myservice'.
Affected parameters are:
logtoconsole =
assemblypath = myservice
logfile = pathtoinstalllog
Uninstalling assembly myservice
Affected parameters are:
logtoconsole =
assemblypath = myservice
logfile = pathtoinstalllog
Removing EventLog source myservice.
Service myservice is being removed from the system...
Service myservice was successfully removed from the system.
Uninstalling assembly myservice'.
Affected parameters are:
logtoconsole =
assemblypath = myservice
logfile = pathtoinstalllog
Removing EventLog source myservice.
Service myservice is being removed from the system...
Service myservice was successfully removed from the system.
(名称 path、myservice、pathtoinstalllog 等代替公司具体信息)
无论如何,从日志文件中看起来好像正在安装服务,然后立即卸载......
如果需要更多代码或信息,请告诉我,并提前致谢。