Cannot find .NET 5.0 Console App project template in Visual Studio 2019

Richard Chang 1 Reputation point
2021-05-05T20:56:32.607+00:00

I'm currently trying to create a C# .NET 5.0 Console Application in Visual Studio 2019, and the option does not appear under project templates as I expect it to.

I downloaded Visual Studio Professional 2019 Version 16.9.4 (from https://visualstudio.microsoft.com/downloads/) and selected all workloads to be installed, then I installed SDK 5.0.202, ASP.NET Core Runtime 5.0.5, .NET Desktop Runtime 5.0.5, and .NET Runtime 5.0.5 (from https://dotnet.microsoft.com/download/dotnet/5.0).

When I go to File -> New -> Project and search for "Console Application", there is no default "Console Application" project template for C#. The closest I can find is "Console Application (.NET Framework)" for C#, VB, and F# and "Console Application" for C++. If I select "Console Application (.NET Framework)" for C#, the latest Framework that I can choose is ".NET Framework 4.8".

Actual Outcome:
8jz6m.png
uH5kf.png

I compared notes with a developer who did not run into this problem, and they see the same framework restriction when they select "Console Application (.NET Framework)" for C#, but is also able to see the project template "Console Application" for C# (without ".NET Framework") and select ".NET 5.0 (Current)" as the target framework as expected. Nothing about what they installed and updated appeared to be noticeably different, our results for the command prompt command "dotnet --info" matched, and they did not have any "Installed products" listed under "About" or "Individual Components" listed under the installer that I was missing.

Expected Outcome:
VTlAr.png
Iymaz.png

I have tried uninstalling and reinstalling everything, exhaustively installing every workload as well as additional individual components that looked potentially relevant, and making sure that the "Tools -> Options -> Environment -> Preview Features -> Show All .NET Core templates in the New project dialog (requires restart)" checkbox is checked.

Does anyone know what step I'm missing that is preventing me from creating a Console Application project template in C# using .NET 5.0?

Developer technologies Visual Studio Other
Developer technologies C#
{count} votes

1 answer

Sort by: Most helpful
  1. Karen Payne MVP 35,586 Reputation points Volunteer Moderator
    2021-05-06T00:34:54.847+00:00

    Hello,

    Here is something to try.

    • Download the following zip file
    • Place the file in the folder C:\Users\ YourUserName \Documents\Visual Studio 2019\Templates\ProjectTemplates\Visual C#
    • Replace YourUserName with your login user name
    • Display the Start window.
    • Type in console
    • Visual Studio will take longer than usual to search, be patient, up to about three minutes.
    • When the progress bar stops, you should see what's shown below.

    What's in the zip file? A console app where the project file is setup for .NET 5/ C# 9 e.g.

    <Project Sdk="Microsoft.NET.Sdk">  
      <PropertyGroup>  
        <OutputType>Exe</OutputType>  
    	  <LangVersion>9.0</LangVersion>  
    	  <TargetFramework>net5.0</TargetFramework>  
      </PropertyGroup>  
    </Project>  
      
    

    Other than that it's a plain Console project. Try building it, see if it build. If not come back and explain what happened.

    Note: Notice I have several project on the left which I created my own project templates.

    94106-figure1.png


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.