Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Can't Target .NET Framework 4.8

I'm having some issues creating a project that targets .NET Framework 4.8. I am using Visual Studio 2019, upgraded to version 16.2.5. I have also installed the .NET Framework 4.8 Developer Pack. From the Visual Studio Installer, I don't see any option for enabling 4.8 development tools similar to 4.7.

like image 799
ElliotSchmelliot Avatar asked Sep 18 '19 20:09

ElliotSchmelliot


People also ask

Why the .NET Framework 4.8 is not supported on this operating system?

That means the 4.8 version is not supported by your current operating windows, actually, you need to upgrade your windows. Visit https://www.microsoft.com/en-us/software-download/windows10, go to "Create Windows 10 installation media" section and download the tool. Install the tool and run it.

Is .NET 4.8 still supported?

Support lifecycle NET Framework 4.8 is the latest version of . NET Framework and will continue to be distributed with future releases of Windows. As long as it is installed on a supported version of Windows, . NET Framework 4.8 will continue to also be supported.

Does .NET 4.8 support C# 8?

NET Framework 4.8. Likewise, default interface member implementations rely on new runtime enhancements, and we will not make those in the . NET Runtime 4.8 either. For this reason, using C# 8.0 is only supported on platforms that implement .


2 Answers

Just had a similar issue with Visual Studio 2019 Community Edition: only .Net Core versions were shown.

I edited the .csproj file manually. I changed the line with the TargetFramework property to

<TargetFramework>net48</TargetFramework> 

Oddly, now all other versions show up also.

like image 186
Bernhard Hiller Avatar answered Sep 19 '22 13:09

Bernhard Hiller


This Visual Studio thread had all the answers I was looking for. The .NET Framework 4.8 Developer Pack includes both the SDK and Targeting Pack. After installing this and restarting Visual Studio, I can now see .NET Framework 4.8 as a targeting option for Visual Studio projects. You should not need to do any Visual Studio Installer steps.

Also mentioned in the above thread, .NET Framework 4.8 will be included in the Visual Studio installation process as of 16.3 (currently listed under 16.3 Preview 2).

like image 39
ElliotSchmelliot Avatar answered Sep 16 '22 13:09

ElliotSchmelliot