How does Topshelf differ from a ASP.NET Core Worker Service? and what are the pros and cons of each of them and are they both support Windows and Linux?
3 Answers
Topshelf is available in .net standard and that means you can use it in .net core apps. That doesn't mean that you can run in on Linux because it is dependent on Windows registry. In the Topshelf docs you can see that it runs on Windows only.
On the other hand, worker services run on .net core 3 and they can run on both Linux and Windows.
So if you have .net framework or .net core 2 or 1 project go ahead with Topshelf and if you have .net core 3 project go ahead with worker service.

- 1,423
- 16
- 32

- 723
- 8
- 23
TopShelf = .NET Framework
Worker Service = .NET Core
There are even articles around how to migrate from TopShelf to Worker Service

- 3,248
- 1
- 19
- 32
-
tnx, but [topshelf](https://www.nuget.org/packages/Topshelf/) support .NETStandard 2.0, doesnt that mean that it can run on .net core environment? – kira May 04 '20 at 12:13
-
1Yes it could work, but why would you want that when you have support out of the box - both projects are similar – riffnl May 04 '20 at 13:12
-
I recommend pulling out your core code from .Net and start using a Worker Service. It's obvious why – Fandango68 Jun 07 '22 at 05:40
Topshelf works with Mono, making it possible to deploy services to Linux. The service installation features are currently Windows only, but others are working on creating native host environment support so that installation and management features are available as well. According to its docs

- 129
- 5