NetCore 2.1 Generic Host as a service

前端 未结 3 1082
北恋
北恋 2021-02-08 18:07

I\'m trying to build a Windows Service using the latest Dotnet Core 2.1 runtime. I\'m NOT hosting any aspnet, I do not want or need it to respond to http requests.

I\

3条回答
  •  梦如初夏
    2021-02-08 18:47

    I hope you found the solution for this problem.

    In my case I used generic host (introduced in 2.1) for such purpose and then just wrap it up with systemd to run it as a service on Linux host.

    I wrote a small article about it https://dejanstojanovic.net/aspnet/2018/june/clean-service-stop-on-linux-with-net-core-21/

    I hope this helps

提交回复
热议问题