我正在尝试使用Visual Studio 2008设置和部署项目安装我的Windows服务应用程序。我创建了一个具有“作为服务运行”权限的用户帐户,并将ServiceProcessInstaller.Account设置为System.ServiceProcess.ServiceAccount.User,同时将用户名和密码设置为我之前创建的用户。
spInstaller.Account = System.ServiceProcess.ServiceAccount.User;
spInstaller.Username = "USER NAME";
spInstaller.Password = "PASSWORD";
sInstaller.ServiceName = "SERVICE NAME";
sInstaller.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
但是在安装过程中,我遇到了以下错误:
错误:1001。帐户名称无效或不存在,或指定的帐户名称的密码无效
有什么想法为什么会出现这个错误,以及如何解决它呢? 谢谢。