C# 服务程序的安装问题

双井巷 2005-10-10 12:57:03
程序安装提示……

正在安装程序集“e:\c#开发文档\csharptest\wtservice\bin\debug\wtservice.exe”。
受影响的参数是:
assemblypath = e:\c#开发文档\csharptest\wtservice\bin\debug\wtservice.exe
logfile = e:\c#开发文档\csharptest\wtservice\bin\debug\wtservice.InstallLog
无法创建 WTService.WTInstaller 安装程序类型的实例。
System.Reflection.TargetInvocationException: 调用的目标发生了异常。
引发了内部异常 System.InvalidOperationException,错误信息如下:appSettings 配置节中不存在项“WTserviceInstaller.DisplayName”。。

可是在配置文件中存在项“WTserviceInstaller.DisplayName”,实在搞不明白了
...全文
93 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
双井巷 2005-10-10
  • 打赏
  • 举报
回复
做了个服务程序,服务程序的属性是用“动态属性”写在config文件里了。编译没有问题,但在服务程序安装时会提示“appSettings 配置节中不存在项”。而这些项在config的appSettings 配置节中都是有的。
双井巷 2005-10-10
  • 打赏
  • 举报
回复
我用的是系统的“动态属性”,好像问题。不知道有没有人知道是咋回事?
q_po_o 2005-10-10
  • 打赏
  • 举报
回复
http://community.csdn.net/Expert/FAQ/FAQ_Index.asp?id=201968
双井巷 2005-10-10
  • 打赏
  • 举报
回复
应该是这里有问题 不过这是系统自己加的代码

this.WTserviceInstaller.DisplayName = ((string)(configurationAppSettings.GetValue("WTserviceInstaller.DisplayName", typeof(string))));
this.WTserviceInstaller.ServiceName = ((string)(configurationAppSettings.GetValue("WTserviceInstaller.ServiceName", typeof(string))));

110,533

社区成员

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

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

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