首页 新闻 会员 周边

.NET4.0 widows服务通过InstallUtil.exe安装时报错。不知道什么原因.

0
悬赏园豆:20 [待解决问题]

“安装”阶段发生异常。System.ComponentModel.Win32Exception:远程过程调用失败

附上提示信息
C:\Windows\Microsoft.NET\Framework\v4.0.30319>installUtil.exe C:\Users\Administr
ator\Desktop\WindowsService1\WindowsService1\WindowsService1\bin\Debug\WindowsSe
rvice1.exe
Microsoft(R) .NET Framework 安装实用工具版本 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.


正在运行事务处理安装。

正在开始安装的“安装”阶段。
查看日志文件的内容以获得 C:\Users\Administrator\Desktop\WindowsService1\WindowsS
ervice1\WindowsService1\bin\Debug\WindowsService1.exe 程序集的进度。
该文件位于 C:\Users\Administrator\Desktop\WindowsService1\WindowsService1\Window
sService1\bin\Debug\WindowsService1.InstallLog。
正在安装程序集“C:\Users\Administrator\Desktop\WindowsService1\WindowsService1\W
indowsService1\bin\Debug\WindowsService1.exe”。
受影响的参数是:
  logtoconsole =
  logfile = C:\Users\Administrator\Desktop\WindowsService1\WindowsService1\Wind
owsService1\bin\Debug\WindowsService1.InstallLog
  assemblypath = C:\Users\Administrator\Desktop\WindowsService1\WindowsService1
\WindowsService1\bin\Debug\WindowsService1.exe
正在安装服务 Service1...
正在日志 Application 中创建 EventLog 源 Service1...

在“安装”阶段发生异常。
System.ComponentModel.Win32Exception: 远程过程调用失败。

正在开始安装的“回滚”阶段。
查看日志文件的内容以获得 C:\Users\Administrator\Desktop\WindowsService1\WindowsS
ervice1\WindowsService1\bin\Debug\WindowsService1.exe 程序集的进度。
该文件位于 C:\Users\Administrator\Desktop\WindowsService1\WindowsService1\Window
sService1\bin\Debug\WindowsService1.InstallLog。
正在回滚程序集“C:\Users\Administrator\Desktop\WindowsService1\WindowsService1\W
indowsService1\bin\Debug\WindowsService1.exe”。
受影响的参数是:
  logtoconsole =
  logfile = C:\Users\Administrator\Desktop\WindowsService1\WindowsService1\Wind
owsService1\bin\Debug\WindowsService1.InstallLog
  assemblypath = C:\Users\Administrator\Desktop\WindowsService1\WindowsService1
\WindowsService1\bin\Debug\WindowsService1.exe
正在将事件日志还原到源 Service1 的前一状态。

“回滚”阶段已成功完成。

已完成事务处理安装。
安装失败,已执行回滚。

XGU_Winner的主页 XGU_Winner | 初学一级 | 园豆:72
提问于:2012-08-28 23:52
< >
分享
所有回答(3)
0

据Win32Exception这个,一般是: 权限问题;是否引用了Win32的DLL文件,路径不对

可以根据具体的代码,屏蔽相关的部分试试,定位某个函数后,查MSDN,看这些函数的使用限制

2012 | 园豆:21230 (高人七级) | 2012-08-29 08:09
0

也遇见了同样的问题,请问有什么办法可以解决

永远的星空 | 园豆:202 (菜鸟二级) | 2012-10-18 16:25
0

System.ArgumentOutOfRangeException: 索引和长度必须引用该字符串内的位置。我报这个错误,不知咋回事。

有趣之极 | 园豆:202 (菜鸟二级) | 2016-12-30 09:29
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册