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?
2
Answers
When are you are trying to create a console application you can choose between Console Application (.NET) and Console Application (.NET Framework)
For example:
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
As you man know, there is
.NET Framework
, and there is.NET
(Previously called.NET Core
). So make sure you don’t confuse between.NET Framework
and.NET
Currently in Visual Studio, whatever project type you find while creating a project is by default
.NET
unless it clearly specify.NET Framework
. In your case, when you see Console Application, it means.NET
. If you want the.NET Framework
, you need to select Console App (.NET Framework)