Visual Studio 2022 no longer supports .NET4.5. If you open a .Net4.8 target package or a .NET version project below .NET 4.8, you will be prompted that it is no longer supported.
I can't find an option for .NET4.5 and below even in the Visual Studio Installer.
So go to the official website to download .Net 4.5? Sorry, prompt during installation: The same or higher version of .NET Framework4.5 is already installed on this computer. As shown below
, is there any other way? The following will introduce in detail:
1. Install a previous version of Visual Studio, such as Visual Studio 2019.
2. Install through NuGet: Open the download page of NuGet's NET Framework 4.5, click the Download package
link on the right to download the target framework.
The downloaded package is in .nupkg format, here change its extension to .zip, and then use the decompression software unzip.
\build\.NETFramework
Copy the folder v4.0
or v4.5
folder in the unzipped directory to C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework
the directory and
restart Visual Studio 2022
3. Use PM to download and install: Open the package manager console and enter:
NuGet\Install-Package Microsoft.NETFramework.ReferenceAssemblies.net45 -Version 1.0.3
and find the download directory.
Enter the Microsoft.NETFramework.ReferenceAssemblies.net45.1.0.2\build\ .NETFramework\v4.5 directory under this directory
Copy all the files in this directory to C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\4.5
the directory
Restart Visual Studio 2022