I'm porting an application from .NET Framework 4.8 to .NET 5.0. Is there there a way to bring the functionality of System.ServiceProcess.ServiceBase to .NET 5.0? Are there any alternatives that could replace ServiceBase? Any workarounds?
Asked
Active
Viewed 3,807 times
1 Answers
11
ServiceBase
is available in the NuGet package System.ServiceProcess.ServiceController. Visual Studio should suggest to install that package if you press Ctrl+. while the cursor is on the ServiceBase
class name in the code editor.
If you create a new service you should think about switching to worker services (it has its own project template), see here. To run those worker services as a Windows service you'd then use the Microsoft.Extensions.Hosting.WindowsServices package. (That package also uses ServiceBase
internally.)

cremor
- 6,669
- 1
- 29
- 72
-
-
@MagicMic Please mark the answer as accepted to indicate that the question is resolved. – cremor Dec 10 '20 at 08:43