how to use ServiceBase in .net core 3.1?

mc 3,701 Reputation points
2023-01-06T02:42:35.543+00:00

can not use ServiceBase in .netcore 3.1 right?

I want to create windows services in .net core 3.1

how to do it?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,415 questions
.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
323 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,126 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jiachen Li-MSFT 26,751 Reputation points Microsoft Vendor
    2023-01-06T05:41:47.33+00:00

    Hi @mc ,
    .NET Core targets cross-platform apps, so it doesn't support anything that's too specific to the operating system.
    You can refer to the following question.
    Implement windows service in .NET 6.0
    Best Regards.
    Jiachen Li


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,931 Reputation points
    2023-01-06T17:08:16.907+00:00

    core 3.1 is out of support. net 6 has a template to create a windows service.

    https://learn.microsoft.com/en-us/dotnet/core/extensions/windows-service

    0 comments No comments