I am attempting to install a C# windows service project using a VisualStudio.Net deployment project.
To run the deployment project I right-click and select "install" from the context menu, the install wizard runs and eventually prompts me with a "Set Service Login" dialog which asks for username & password.
When I install a service using the sc utility from the command line, I don't have to provide credentials.
Do I have to create a login just for this service? I'd prefer to use "Local System" or "Network Service" (not sure what the difference is) as other services do.
Add this code to your private void InitializeComponent()
method in projectInstaller.Designer.cs
file in your windows service project.
this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
if the definition of you process installer is:
private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1;
Check this Link: http://msdn.microsoft.com/en-us/library/zt39148a(v=vs.110).aspx
Pay attention to this section: To create the installers for your service
Make changes to your ServiceProcessInstaller:
In the designer, click ServiceProcessInstaller1 for a Visual Basic project, or serviceProcessInstaller1 for a Visual C# project. Set the Account property to LocalSystem. This will cause the service to be installed and to run on a local service account.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With