Hosting .netcoreapp1.0 as windows service


#1

Hi, I’m trying to deploy my .net core application as a windows service (later on as a Linux daemon). I tried to use SC create binpath=“dotnet path\to\published.dll”. Service created but fails to start throwing an error 1503.
I tried Anyservice but it starts silently without any logs, that I expect to be written in file at start. Top shelf isn’t available for .netcore.
What options do I have, I need my console app to be restored in case of crash. Stopped in case of re-deploy. In other words, everything that usually done by Windows service.


#2

This thread on github might give you some resources about services in windows with dot net core.


#3

Hello, take a look at these. I Ended up implementing something that works pretty much like very (very) simplified Topshelf. You can easily run as console and/or install, uninstall and so one as a service. I think it can be pretty useful for somebody. You can find the code here : https://github.com/PeterKottas/DotNetCore.WindowsService and there’s nuget here as well https://www.nuget.org/packages/PeterKottas.DotNetCore.WindowsService/ . Enjoy :slight_smile:


.NET Foundation Website | Blog | Projects | Code of Conduct