NOTE: I'm not doing anything similar to Topshelf installer requires me to press enter twice - why?
Service class (interesting parts):
public class ServiceCore
{
public ServiceCore(ServiceRuntimeConfiguration serviceRuntimeConfiguration)
{
_runningTasks = new List<Task>();
}
public bool Start(HostControl hostControl)
{
_hostControl = hostControl;
_messageProcessor.Start(); // Starts a System.Threading.Tasks.Task
StartListener(); // starts a System.Threading.Tasks.Task
return true;
}
}
Program.cs:
Host host = HostFactory.New(configurator =>
{
configurator.UseNLog();
// Configure core service
configurator.Service<ServiceCore>(svc =>
{
svc.ConstructUsing(theService => new ServiceCore(_serviceRuntimeConfiguration));
svc.WhenStarted((svc, hostControl) => svc.Start(hostControl));
svc.WhenStopped((svc, hostControl) => svc.Stop(hostControl));
});
// Configure recovery params
configurator.EnableServiceRecovery(recoveryConfigurator =>
{
recoveryConfigurator.RestartService(0);
recoveryConfigurator.OnCrashOnly();
recoveryConfigurator.SetResetPeriod(1);
});
// Execute HostConfigurator
host.Run();
}
The Problem
When I do this:
MyService.exe install --manual --localsystem
The service installs fine, but the command never returns:
Running a transacted installation.
Beginning the Install phase of the installation. Installing service NotificationEngine.Main... Service NotificationEngine.Main has been successfully installed.
The Install phase completed successfully, and the Commit phase is beginning.
The Commit phase completed successfully.
The transacted install has completed.
^C (I have to press CTRL+C)
What should I do for the install command to complete and then return?
NOTE The same behaviour is observable if I run help (i.e. help displays but the command does not return):
MyService.exe help