自己按着书上写了自编了一个windows服务程序,但是在使用installutil安装时提示出错:
在“安装”阶段发生异常。
System.ComponentModel.Win32Exception: 帐户名无效或不存在,或者密码对于指定的帐户名无效。请达人指点

解决方案 »

  1.   

    你的帐号是怎么设置的?设置成localsystem再试试?安装程序是怎么做的
      

  2.   

    安装文件为Windows服务的正确安装做好了工作,它包括了一个Windows服务的安装类,该类是重System.Configuration.Install.Installer继承过来的。安装类中包括了Windows服务运行所需的帐号信息,用户名、密码信息以及Windows服务的名称,启动方式等信息。 
      // 设定ServiceProcessInstaller对象的帐号、用户名和密码等信息                     this.spInstaller.Account =               System.ServiceProcess.ServiceAccount.LocalSystem;                     this.spInstaller.Username = null;                     this.spInstaller.Password = null;                     // 设定服务名称                     this.sInstaller.ServiceName = "FileMonitorService";                     // 设定服务的启动方式                     this.sInstaller.StartType =               System.ServiceProcess.ServiceStartMode.Automatic;
      

  3.   

    刚刚Account 改成 LocalSystem就好了,可是书上说要设置为LocalService的说,奇怪了