求助:用C#创建的Windows Service安装时出现密码?(已解决)

我用C#创建了一个Windows Service程序,也同时创建了一个ProjectInstaller。然后生成服务程序的可执行文件,安装。
当使用installutil.exe工具进行安装时,提示输入用户名和密码。我输入了我的管理员的用户名和密码也不行。
后来即使切换到adminitrator用户下,重启,再安装,也需要输入用户名和密码,结果还是不对。
以下是提示信息,请大家看看,是为什么。谢谢!

Found .NET Framework version 2.0.50727
Installing service "MyServices.exe"
Microsoft (R) .NET Framework Installation utility Version 2.0.50727.42
Copyright (c) Microsoft Corporation.  All rights reserved.


Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the C:\Program Files\tech\TS.Services\MySer
vices.exe assembly's progress.
The file is located at C:\Program Files\tech\TS.Services\MyServices.InstallLog.
Installing assembly 'C:\Program Files\tech\TS.Services\MyServices.exe'.
Affected parameters are:
   logtoconsole =
   assemblypath = C:\Program Files\tech\TS.Services\MyServices.exe
   logfile = C:\Program Files\tech\TS.Services\MyServices.InstallLog

An exception occurred during the Install phase.
System.ComponentModel.Win32Exception: No mapping between account names and secur
ity IDs was done

The Rollback phase of the installation is beginning.
See the contents of the log file for the C:\Program Files\tech\TS.Services\MySer
vices.exe assembly's progress.
The file is located at C:\Program Files\tech\TS.Services\MyServices.InstallLog.
Rolling back assembly 'C:\Program Files\tech\TS.Services\MyServices.exe'.
Affected parameters are:
   logtoconsole =
   assemblypath = C:\Program Files\tech\TS.Services\MyServices.exe
   logfile = C:\Program Files\tech\TS.Services\MyServices.InstallLog

The Rollback phase completed successfully.

The transacted install has completed.
The installation failed, and the rollback has been performed.
DONE!!!
Press any key to continue . . .

原文地址:https://www.cnblogs.com/saptechnique/p/1101733.html