Closed hema2013 closed 5 years ago
what did you pass to sc.exe
? what executable shown in the service details/properties in the service management console?
"Test Service" != "Test Api Service22"
@hema2013 also note that it may not work with the build output. try using dotnet publish -r win-x64
and use the the executable in the publish/
subdirectory of the output folder.
Using the build output may or may not work depending on service and system configurations (permissions).
Closing due to the OP not responding, please comment if the issue is still not resolved!
Hello,
I have Create a simple example (Console App .Net Core) :*
public class ServiceHost : IWin32Service { public string ServiceName => "Test Service";
}
static void Main(string[] args) { var host = new ServiceHost(); var win32Host = new Win32ServiceHost(host); win32Host.Run(); }