编写service的初级问题。(应该很容易的,来抢分啊)

kamphkb 2002-09-05 01:14:18
我按照vs.net上面的“演练”创建一个service。编译通过,但安装不上?
具体的操作和错误如下:

C:\>installutil E:\myprojects\testing\WindowsService2bin\Debug\WindowsService2.exe
Error dispatching command/test named 'E:\myprojects\testing\WindowsService2\bin\Debug\WindowsService2.exe'

Here is the list of valid command/test/option names:
+-------------------------------------------------
| registerdatapath
| registersqlanywherepath
| registersqlanywherebinpath
| getdatapath
| getsqlanywherepath
| getsqlanywherebinpath
| registersqlanywhereodbcdriver
| registeroracleoptions
| getoracleoptions
| validateschemarepovendorinfo
| validateuservendorinfo
| validatedbisempty
| describelastinstalledschemarepo
| initemptyschemarepo
| relocateschemarepo
| relocateuserdb
| convertuserdb
| convertschemarepo
| copyuserdb
| copyschemarepo
| clientregisterschemarepo
| registerschemarepofromfile
| adddbset
| dropdbset
| renamedbset
| copydbset
| disconnectuserdb
| reconnectuserdb
| exportschemarepo
| exportoldschemarepo
| importschemarepo
| exportschemafromuserdb
| upgradeschemareposystemversion
| upgradeuserdbsystemversion
| unlockschemarepo
| unlockuserdb
| catchuptestdbs
| cloneschema
| deleteschema
| purgedeleteduserdb
| restoreuserdbschema
| clearstatemachine
| setschemarestriction
| setrecursionlimit
| dropchoicelist
| checkin
| uncheckout
+-------------------------------------------------
...全文
35 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
kamphkb 2002-09-06
  • 打赏
  • 举报
回复
To: hoocsdn()

能否具体一点?
hoocsdn 2002-09-06
  • 打赏
  • 举报
回复
我记得是要修改一下运行服务的权限,
localsystem
kamphkb 2002-09-06
  • 打赏
  • 举报
回复
当然不是。
kamphkb 2002-09-06
  • 打赏
  • 举报
回复
能不能发你们的代码过来(kcii_hkb@163.com)?或者贴出来。
xiaomili 2002-09-06
  • 打赏
  • 举报
回复
添加了installer属性了吗?

我做了,可以啊!
hoocsdn 2002-09-06
  • 打赏
  • 举报
回复
我也没辙了
我调试vs.net中的windows service例子时,
也是一样,编译通过,安装不上
改了它的运行account为localsystem就行了
kamphkb 2002-09-06
  • 打赏
  • 举报
回复
我在安装的构造里加了:
public ProjectInstaller()
{
// 该调用是设计器所必需的。
InitializeComponent();

// TODO: 在 InitComponent 调用后添加任何初始化

// The services run under the system account.
serviceProcessInstaller1.Account = ServiceAccount.LocalSystem;
}
还是不行! :(
hoocsdn 2002-09-06
  • 打赏
  • 举报
回复
我是以前试验vs.net中的一个window service例子不能通过,
你搜索一下processInstaller.Account
kamphkb 2002-09-06
  • 打赏
  • 举报
回复
写在程序里?写在具体什么位置?
hoocsdn 2002-09-06
  • 打赏
  • 举报
回复
不知是不是这个
processInstaller.Account = ServiceAccount.LocalSystem;
larson 2002-09-05
  • 打赏
  • 举报
回复
你的问题我想我能解决,但我不会抢你的分!!

E:\myprojects\testing\WindowsService2bin\Debug\WindowsService2.exe
路径是不是错了?有问题再说?

110,538

社区成员

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

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

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