.NET 5 not available in Visual Studio 2019 - visual-studio

I have downloaded and installed .NET Core 5.0 SDK (v5.0.100-preview.1) in my Visual Studio 2019.
But it is not available in Target framework.
Am I missing something?

You need to install the latest preview of Visual Studio 2019 16.8, refer to
https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-5-preview-1/
You also need to explicitly enable preview versions within Visual Studio itself:
Then you should see it:

Specs: VS Version 16.8.0
Target Version of .Net Core: 5.0
You must have version 16.8.0 in order to have .Net Core 5.0
If you still have problems with Visual Studio not showing .Net Core 5.0 in Visual Studio version 16.8.0 (and assuming you downloaded the .NET Core 5.0 SDK for Visual Studio), well, apparently (and correct me if I'm wrong) it is now called just .Net 5.0, omitting the Core.
After selecting .NET 5.0, I was able to install other libraries which are currently version 5.0+ and dependent on .NET Core 5.0+
Is the new name intentional? Anyways, here some evidence of this working (I was able to install the newest version of Newtonsoft and Entity Framework for .Net Core):
Funny enough, when I try to create a new .Net Core project, the version shows up as expected:

I upgraded my version of Visual studio from 16.7.x to 16.8.1. I expected NET 5 to be listed as a target framework, but it was not.
I had previously created projects in 16.8 preview 6 using RC1.
Visual Studio Install did not list .NET 5 as an individual component either. I then downloaded and installed the x64 SDK. Still no luck. .NET5 was still missing as a target framework for VS 16.8.x
Today I opened VS Installer and from the More dropdown menu selected Repair . The repair process took 25-30 minutes to run, but now .NET Core 3.1 and .NET 5 are listed in all the usual places.
Norm

Maybe a bit late to the party.
Please note that if you've selected a 'regular' .NET Framework application you won't see the .NET 5.0 Framework option.
This is only visible in .NET Core project styles.

Try to set it in your .csproj file. Right click (maybe unload) and edit (within a PropertyGroup-element):
<TargetFramework>net5.0</TargetFramework>

Targeting .NET 5 (rc2) doesn't work smoothly in VS Version 16.8.0 Preview 6.0
I could only target .NET 5 by manually changing the .csproj file, and adding:
<TargetFramework>net5.0</TargetFramework>

When I wanted to create a solution, .NET 5 was not available, even when I have it installed. What I did to fix this was:
When you are creating the project, select the last version (in my case .NET Core 3.1)
When the project is created, right click on the project and select the Properties option.
In the Application tab, select the Target Framework you want.

Related

Setup project visual studio 2022

What can be the reason that install is greyed out?
Microsoft Istaller projects 2022 is installed. Solution can build without problems.
It's an old project where .net Framework 4.0 is used.
I'm just guessing, but it might be that .NET Framework 4.0 is deprecated and support was removed. You can't even install it via the Visual Studio Installer's Individual Components. The lowest 4.x targeting pack version I could install is 4.6.
Try installing the latest .NET Framework targeting pack and then re-target the project to use that.

Why isn't .NET Core 3.1 showing up in Visual Studio after Iinstalled it?

Just installed .NET Core version 3.1.
I'm using Visual Studio 2019, version 16.4.2, so it should be compatible.
But when I try to "create a new project" nothing Core-related shows up in the list, no matter how many ways I try to query.
I'm told it should show up but it doesn't. Haven't a clue as to why (I assume I've missed a step along the way).
VS 2019 16.4.x will always have .NET Core 3.1 as its main target by default, and VS 2019 16.4.0 or later will always install .NET Core 3.1.100 SDK if you select .NET Core workload when you install VS 2019.
If it's not shown when creating new project, then you have to ensure that you have selected the .NET Core workload when you install VS 2019:
Eriawan's answer pointed me in the right direction. The problem was, as suspected, very simple. I had bypassed Core when first installing VS 2019. Just had to use the Installer and install to fix.

Cannot target .NET Framework 4.6.1

I try to load an existing project (not mine) that I get from TFS and I got an error telling me that I need .NET Framework 4.6.1 to load it.
So I downgraded it to 4.6, successfully load it, install .NET Framework 4.6.1 but I can't make my project target on 4.6.1.
The link where I get .NET framework
I'm on Windows 7 and I use Visual Studio Community 2017.
You may need to install the developer pack. It looks like you may have just installed the runtime. You can find the .NET Framework 4.6.1 developer pack here.

Framework 4.6.2 not available in Visual Studio 2015?

I'm currently using Visual Studio 2015 with framework version 4.6.1. I need to use TLS 1.2 with my app. From what I've read, TLS 1.2 is the default with framework version 4.6.2. But, that version isn't listed in visual studio:
VS 2015 Frameworks listed in my project properties
I downloaded the 4.6.2 installer, but when I try to install it, the installer indicates:
".NET Framework 4.6.2 or a later update is already installed on this computer."
So, my questions are:
1) Can framework 4.6.2 be used in VS 2015? (if so, what do I have to do?)
2) Can I use TLS 1.2 with the framework 4.6.1?
Appreciate any help!
You probably need to install the 4.6.2 SDK. It includes the reference assemblies for 4.6.2, which is what Visual Studio needs in order to target 4.6.2 for builds.
SDKs for all .NET versions (3.5+) are available from the .NET SDKs for Visual Studio page.

.Net Core 2.1 templates missing from VS2017

I have VS2017 (15.5.4) Professional already installed and today I installed .Net Core SDK 2.1.4 but I cannot see any Core templates in the New Project dialog in VS.
If I run dotnet --version in Powershell, it correctly shows me 2.1.4 installed
I have removed all Core installations on my windows 10 machine, reinstalled 2.1.4, run the repair on VS and also tried devenv /installvstemplates but nothing seems to work.
Can anyone help please?
For .NET Core 2.1, you need Visual Studio version 15.7 or higher. (check it from Help menu > About Microsoft Visual Studio). So, first ensure you have update your visual studio.
Now, to add .NET Core 2.1 (or other newer templates) to visual studio, you need to install the Latest .Net Core SDK from here.
For any templates: Make sure VS has the necessary components, make sure that the cross platform development workload is installed through the Visual Studio Installer.
The SDK 2.1.* only contains the 2.0.* runtimes. At the time of writing, there has been no public preview release for .NET Core 2.1.
You can download 2.2.0 SDK previews from https://github.com/dotnet/cli.
Note that the naming may change in the near future in order to avoid confusion and keep the SDK and Runtime major and minor versions in sync - see https://github.com/dotnet/designs/pull/29.
Update Visual Studio to version 15.6.0.

Resources