[RESOLVED] [02/03] Error installing my service with installutil
Hello,
I completed writing the service I was working on yesterday and was able to have it install and run on my development machine under a local user account. I'm running into an issue when I move it over to the client's machine and need to install it under a domain account. When executing the command:
installutil "C:\work\CedarsImpromptu\stisvcimp\bin\stisvcimp.exe"
from the .NET Framework 2.0 direcory I receive the error:
"An exception occured during the Install phase.
System.ComponentModel.Win32Exception: No mapping between account names and security IDs was done"
Here is the source code for the relevent portion of the service installer, please let me know if you need any more information. I found another example of this on the net but in that case it was due to the developer omitting the Account Property in the ServiceProcessInstaller object.
Private components As System.ComponentModel.IContainer
Friend WithEvents ServiceProcessInstaller As System.ServiceProcess.ServiceProcessInstaller
Friend WithEvents ServiceInstaller As System.ServiceProcess.ServiceInstaller
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.ServiceProcessInstaller = New System.ServiceProcess.ServiceProcessInstaller
Me.ServiceInstaller = New System.ServiceProcess.ServiceInstaller
'
'ServiceProcessInstaller
'
Me.ServiceProcessInstaller.Account = ServiceProcess.ServiceAccount.User
Me.ServiceProcessInstaller.Password = "xxxxx"
Me.ServiceProcessInstaller.Username = ".\\Domain\Username"
'
'ServiceInstaller
'
Me.ServiceInstaller.ServiceName = "stisvcimp"
Me.ServiceInstaller.StartType = System.ServiceProcess.ServiceStartMode.Automatic
'
'ProjectInstaller
'
Me.Installers.AddRange(New System.Configuration.Install.Installer() {Me.ServiceProcessInstaller, Me.ServiceInstaller})
End Sub
Re: [02/03] Error installing my service with installutil
Nevermind :)
In testing I had to set the username as ".\username" to install the service under a local account. When installing under a domain account the syntax appears to be simply "domain\username". The service installed correctly now.