Search code examples
c#asp.net.netvisual-studiodevelopment-environment

Access .NET 5 in Visual Studio


I'm fairly new to C# an dotnet and I'm struggling a bit with the environment. I'm working on Windows 10 Professional.

I have Visual Studio Community 2019 installed with Development .NET Desktop ticked. I then installed successfully both .NET 5.0 SDK and runtime. When I go to a terminal and type dotnet -v, I get 5.0.401.

However when I create a Console App (.NET Framework) project, I get the choice between .NET Framework 4, 4.5, 4.5.1,4.5.2, 4.6, 4.6.1, 4.6.2 and 4.7.2! I don't see my .NET 5 framework! How can this be?

If I chose ASP.NET Core Web App, I do get the choice between .NET Core 3.1 (Long-term support) and .NET 5.0 (Current).

There's obviously something I don't understand. Is there a difference between the .NET version for Console/Windows app and for Web App? Am I doing something wrong in the installation or configuration?


Solution

  • When are you are trying to create a console application you can choose between Console Application (.NET) and Console Application (.NET Framework)

    For example:

    dotnet new console -n "MyConsoleProject"
    

    will create a .net 5 console application which you can open with visual studio

    .NET Framework and .NET Core (or just .NET nowadays) are different. .NET Framework 5 does not exist, there is a nice table here with all the versions of the .NET platform

    .NET is a continuation of .NET Core (a cross-platform library which ended with .NET Core 3.1) .NET Framework is completely separate and only targets the windows platform