how to make visual studio 2019 .NET 5.0 windows service program

jinsun 0 Reputation points
2023-05-15T12:59:25.9+00:00

I want to create a program written in C# .NET 5.0 as a Windows service program.

I am currently using Visual Studio 2019, but I do not see a Windows Service template for .NET, only for .NET Framework. Has the template been discontinued? Does this mean there is no way to create a Windows service project with .NET 5.0 or .NET Core?

I have tried various methods but have been unsuccessful. Can you provide a solution?

thank you,

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,401 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 58,121 Reputation points
    2023-05-15T14:57:18.9433333+00:00

    First, .net 5 is out of support and should not be used for new projects. Second it’s just a nuget package you add, rather than project type.

    https://learn.microsoft.com/en-us/dotnet/core/extensions/windows-service?pivots=dotnet-7-0

    0 comments No comments