.NETCoreApp 2.0 option missing from "Target framework" dropdown of project properties, after installing 2.0

voxoid picture voxoid · Aug 19, 2017 · Viewed 13.4k times · Source

I had a .NETCoreApp 1.1 Console App created in Visual Studio 2017 Community, and wish to upgrade it to 2.0.0 (so I can use Microsoft.AspNetCore.WebSockets 2.0.0). In project properties, I expand the "Target frameworks" dropdown, select "Install other frameworks...", download .NET Core 64-bit, complete the installer, restart visual studio, but the 2.0 framework is still not available from the dropdown; only 1.0 and 1.1.

I also tried installing the 32-bit version, and then the main Core 2.0 SDK (64-bit). Still no option. I also tried manually editing the project file to point everything to 2.0, but then I get build errors, and the dropdown selection is blank and the 2.0 option still not there.

What is the proper way to make 2.0 a target framework?

Answer

ironstone13 picture ironstone13 · Aug 19, 2017

You might need to update your visual studio Version 15.3.0 and install .NET Core 2.0 SDK - then you should be able to see all your options in Target Framework the drop-down.

If you have installed all the updates above, and you still don't see it, try the following.

Edit your *.csproj file and set your target framework to the proper value <TargetFramework>netcoreapp2.0</TargetFramework> like below.

Keep in mind that you have to update your NuGet packages afterward, by running Update-Package from your NuGet Package Manager Console

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
    <DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
  </PropertyGroup>