Home Dashboard Directory Help

Service(Process)Installer should support virtual and managed service accounts by J Stangroome


 as Deferred Help for as Deferred

Sign in
to vote
Type: Bug
ID: 795196
Opened: 7/28/2013 12:15:01 AM
Access Restriction: Public
User(s) can reproduce this bug


The System.ServiceProcess.ServiceProcessInstaller and ServiceInstaller classes do not support virtual accounts (eg NT SERVICE\servicename) or Managed Service Accounts (Group or Standalone).

ServiceInstaller.Install calls the CreateService win32 API which requires that the Password parameter be passed as NULL for virtual or managed accounts. Unfortunately there is no valid code path which allows the Password to be NULL while specifying a Username for a virtual or managed account.
Sign in to post a comment.
Posted by Microsoft on 8/5/2013 at 4:29 PM
Hi J Stangroome

Thank you for your feedback.

We are not going to be able to address this issue in our next release due to other priorities, however we have logged it and we will continue thinking about addressing it in a future release.

Alex Ghiondea
.NET Framework team
Posted by Microsoft on 7/29/2013 at 11:59 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by J Stangroome on 7/29/2013 at 9:31 PM
Demo project attached.
Posted by Microsoft on 7/29/2013 at 7:28 PM
Thank you for submitting feedback on Visual Studio and .NET Framework. In order to efficiently investigate and reproduce this issue, we are requesting additional information outlined below.

Could you please give us a demo project to demonstrate this issue so that we can conduct further research?

We look forward to hearing from you with this information.

Microsoft Visual Studio Connect Support Team
Posted by MS-Moderator07 on 7/28/2013 at 9:04 PM
Thank you for your feedback, We are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly (http://support.microsoft.com/)
Sign in to post a workaround.
Posted by J Stangroome on 7/28/2013 at 12:27 AM
Using reflection to modify the private "hasLoginInfo" field of ServiceProcessInstaller instance to "true" after setting the Username property as desired and the Password property to null allows virtual accounts to be used but is obviously a "hack" and unsupportable.

This workaround also requires that ServiceInstallers install before the ServiceProcessInstaller by placing both inside the same parent, with ServiceInstallers first. If the ServiceInstallers are children of the ServiceProcessInstaller, or come after, the install fails with the error "No mapping between account names and security IDs was done" from the GetAccountSid method.
File Name Submitted By Submitted On File Size  
ServiceInstallerRepro.zip 7/29/2013 5 KB
ServiceInstallerRepro.zip 7/29/2013 5 KB