windows服务为何没有出现???

zhuqijuncsdn 2003-12-27 11:51:28
我用C#建了一个windows服务,然后用installutil.exe安装并提示成功,但我在服务及应用程序终就是找不到这个服务。而我又可以卸载成功。

那位可以帮帮忙吗??不甚感激!!!


安装时提示信息如下:
E:\temp\WinSevice\WinSericeZQJ\bin\Debug>installutil.exe winservicezqj.exe
Microsoft (R) .NET Framework Installation utility Version 1.0.3705.0
Copyright (C) Microsoft Corporation 1998-2001. All rights reserved.


Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the e:\temp\winsevice\winsericezqj\bin\debu
g\winservicezqj.exe assembly's progress.
The file is located at e:\temp\winsevice\winsericezqj\bin\debug\winservicezqj.In
stallLog.
Installing assembly 'e:\temp\winsevice\winsericezqj\bin\debug\winservicezqj.exe'
.
Affected parameters are:
assemblypath = e:\temp\winsevice\winsericezqj\bin\debug\winservicezqj.exe
logfile = e:\temp\winsevice\winsericezqj\bin\debug\winservicezqj.InstallLog
No public installers with the RunInstallerAttribute.Yes attribute could be found
in the e:\temp\winsevice\winsericezqj\bin\debug\winservicezqj.exe assembly.

The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the e:\temp\winsevice\winsericezqj\bin\debu
g\winservicezqj.exe assembly's progress.
The file is located at e:\temp\winsevice\winsericezqj\bin\debug\winservicezqj.In
stallLog.
Committing assembly 'e:\temp\winsevice\winsericezqj\bin\debug\winservicezqj.exe'
.
Affected parameters are:
assemblypath = e:\temp\winsevice\winsericezqj\bin\debug\winservicezqj.exe
logfile = e:\temp\winsevice\winsericezqj\bin\debug\winservicezqj.InstallLog
No public installers with the RunInstallerAttribute.Yes attribute could be found
in the e:\temp\winsevice\winsericezqj\bin\debug\winservicezqj.exe assembly.
Remove InstallState file because there are no installers.

The Commit phase completed successfully.

The transacted install has completed.

卸载提示信息如下:
E:\temp\WinSevice\WinSericeZQJ\bin\Debug>installutil.exe /u winservicezqj.exe
Microsoft (R) .NET Framework Installation utility Version 1.0.3705.0
Copyright (C) Microsoft Corporation 1998-2001. All rights reserved.



The uninstall is beginning.
See the contents of the log file for the e:\temp\winsevice\winsericezqj\bin\debu
g\winservicezqj.exe assembly's progress.
The file is located at e:\temp\winsevice\winsericezqj\bin\debug\winservicezqj.In
stallLog.
Uninstalling assembly 'e:\temp\winsevice\winsericezqj\bin\debug\winservicezqj.ex
e'.
Affected parameters are:
assemblypath = e:\temp\winsevice\winsericezqj\bin\debug\winservicezqj.exe
logfile = e:\temp\winsevice\winsericezqj\bin\debug\winservicezqj.InstallLog
No public installers with the RunInstallerAttribute.Yes attribute could be found
in the e:\temp\winsevice\winsericezqj\bin\debug\winservicezqj.exe assembly.

The uninstall has completed.

...全文
253 9 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
dreammaster 2003-12-31
  • 打赏
  • 举报
回复
installer = new ServiceInstaller();
processInstaller = new ServiceProcessInstaller();

processInstaller.Account = ServiceAccount.LocalSystem;

installer.ServiceName = "ServiceZQJ";
installer.StartType = ServiceStartMode.Manual;

Installers.Add(installer);
Installers.Add(processInstaller);

将上面代码放在你的Installer构造类中试试。
dreammaster 2003-12-30
  • 打赏
  • 举报
回复
在Console下使用Net Start ServiceZQJ不行吗?
shangguancheng 2003-12-30
  • 打赏
  • 举报
回复
在服务的安装程序控件(ServiceInstaller)中设,其中有一个DisplayName的属性。
zhuqijuncsdn 2003-12-30
  • 打赏
  • 举报
回复
shangguancheng(潜龙勿用):
你好!
服务的安装程序控件(ServiceInstaller)中DisplayName的属性,没有找到呀,能否具体一点

dreammaster(天涯):
你好!
我在Console下使用Net Start ServiceZQJ 提示“服务名无效”
wuyeniao 2003-12-29
  • 打赏
  • 举报
回复
up
zhuqijuncsdn 2003-12-29
  • 打赏
  • 举报
回复

IceboundRock、popu2(混口饭吃)
你好:

请问DisplayName在那设置呀!!
IceboundRock 2003-12-28
  • 打赏
  • 举报
回复
你的服务的DisplayName是什么啊?或者把“服务”关掉再重新打开
popu2 2003-12-28
  • 打赏
  • 举报
回复
DisplayName ServiceName 两个都要设,并同名
zhuqijuncsdn 2003-12-28
  • 打赏
  • 举报
回复
IceboundRock你好:
一、DisplayName在那设置呀!!是不是ServiceName呀,我设置ServiceName = ‘ServiceZQJ’
二、我把“服务”重新刷新,或重启机器都没有看到
三、开始还怀疑服务名被我搞错了,但我数了一下“服务”中服务安装前后的总数量没变

111,092

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧