I have developed a windows service using C# and Visual Studio 2008. I have Windows XP SP2 installed on my machine. When I try to install the service using the
If the account is a local user account, try to use .\username
when installutil prompts for the username and password.
The .\
stands for local machine.
Services require a fully qualified username (with domain), so when installing you need to be explicit about local user accounts.
The account may also need to be given the "Log on as a service" account right; pass the SE_SERVICE_LOGON_NAME
constant to the LsaAddAccountRights()
API.
I solved this by changing ServiceProcessInstaller.Account to LocalSystem, and it works for me.