I am using topshelf along with .net core and registering it with command line parameter something like below.
x.AddCommandLineDefinition("mode", f => { mode = f; });
x.ApplyCommandLine();
The below commands for installing service works perfectly but it gives exception while starting the service
sample.exe install -mode:normal
This executes and installs the service without exception. However,
sample.exe start -mode:normal
throws this generic exception.The service did not respond to the start or control request in a timely fashion --- End of inner exception stack trace --- at System.ServiceProcess.ServiceController.Start(String[] args) at Topshelf.Runtime.Windows.WindowsHostEnvironment.StartService(String servic eName, TimeSpan startTimeOut) at Topshelf.Hosts.StartHost.Run()
Thanks in advance.