I am trying to create a simple Windows Service based on this walkthrough. When I try to execute the command:
C:\worl\Project Alpha\Code\AlphaBackendService\AlphaBackendService\bin\Debug>ins
tallutil.exe AlphaBackendService.exe
It presents a dialog box with username, Password, Confirm password. Nothing I enter works and the install fails. What account does it want? Why can't I just use anything I type in? IIs it because of the EventLog requiring permission:
public partial class AlphaBackendService : ServiceBase
{
public AlphaBackendService()
{
InitializeComponent();
if (!System.Diagnostics.EventLog.SourceExists("AlphaSource"))
{
System.Diagnostics.EventLog.CreateEventSource("AlphaSource", "AlphaLog");
}
eventLog1.Source = "AlphaSource";
eventLog1.Log = "AlphaLog";
}
protected override void OnStart(string[] args)
{
eventLog1.WriteEntry("In OnStart");
}
protected override void OnStop()
{
eventLog1.WriteEntry("In OnStop");
}
}
In the ProjectInstaller, set the propery Account to LocalSystem (From designer) or set following code in InitializeComponent() method
this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
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