Search code examples
wpfwindowsservicenssm

NSSM can't start windows service


I'm trying to run my wpf service with nssm service manager. The problem is that using nssm I can install service, but then when I try to start it I get the following response in terminal:

MyService: Unexpected status SERVICE_PAUSED in response to START control.

Then in EventViewer I get the following error:

Service cannot be started. The service process could not connect to the service controller

Although I can start my service using NET commands, or using VisualStudio, but this problem occurs only with nssm...

Framework: .NET Framework 4.6.1

Any suggestions on how to fix this issue?

EDIT 1

I created sample WPF service using https://learn.microsoft.com/en-us/dotnet/framework/windows-services/walkthrough-creating-a-windows-service-application-in-the-component-designer example. And the result is still the same.

EDIT 2

I managed to get NSSM error:

Cannot start service from the command line or a debugger.  A Windows Service must first be installed (using installutil.exe) and then started with the ServerExplorer, Windows Services Administrative tool or the NET START command.

I don't get how nssm works now....


Solution

  • I found an answer!

    I was too dumb to realize that nssm is a service manager, and I tried to run with it a windows service...

    All I needed to do is to make a simple console application instead of service...