My laptop which has only had Visual Studio 2022 installed and has no history of any other versions being installed will not load projects targeting .NET Framework 4.5. It suggests a download, but no suitable files are available from the Microsoft download pages any more.
Thomas Levesque's instructions for a fix seem dangerous, but after several futile experiments I found that his steps work:
Download the Nuget package Microsoft.NETFramework.ReferenceAssemblies.net45
Rename the following folder (to keep a backup) and replace it with the v4.5 folder unzipped from the NuGet package.
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5
Thereafter VS2022 can open, build and run 4.5 projects. You'll need suitable account permission to rename and replace the folders.
All of the .NET Framework 4.5 projects referred to in this post were updated in recent years to 4.8. The upgrade process was relatively smooth and it only took a few hours to delete all binary output files, change all the csproj file numbers and rebuild everything.
Upgrading to 4.8 also allows you to use the large number of NuGet packages that target netstandard2.0, so you can write more application code with similar functionality in both .NET Framework 4.8 and .NET 8+ (if you need to do that).