dasMulli / dotnet-win32-service

Helper classes to set up and run as windows services directly on .net core. A ServiceBase alternative.
MIT License
451 stars 57 forks source link

DasMulli.Win32.ServiceUtils #74

Closed hema2013 closed 5 years ago

hema2013 commented 6 years ago

Hello,

static void Main(string[] args) { var host = new ServiceHost(); var win32Host = new Win32ServiceHost(host); win32Host.Run(); }

dasMulli commented 6 years ago

what did you pass to sc.exe? what executable shown in the service details/properties in the service management console?

mateusz-jablonski94 commented 6 years ago

"Test Service" != "Test Api Service22"

dasMulli commented 6 years ago

@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).

dasMulli commented 5 years ago

Closing due to the OP not responding, please comment if the issue is still not resolved!