Open .net framework 4.5 project in VS 2022. Is there any workaround?

Here is an automated solution. It follows the steps in this answer: https://stackoverflow.com/a/70109092/569302 When it copies the files a dialog may appear that you have to click to replace files that already exist

(Note: You may need to update the "version" "1.0.2" to whatever is latest if there's a newer NuGet package)

Run await DevHelpers.Download();

using Microsoft.VisualBasic.FileIO;
using System;
using System.Collections.Generic;
using System.IO.Compression;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace j.Dev
{
    public class DevHelpers
    {
        public static async Task Download()
        {
            var version = "1.0.2";
            var name = "Framework45-" + DateTimeToFileString(DateTime.Now);
            var fileName = $"{name}.zip";
            var url = $"https://www.nuget.org/api/v2/package/Microsoft.NETFramework.ReferenceAssemblies.net45/{version}";
            await DownloadFile(fileName, url);
            ZipFile.ExtractToDirectory(fileName, name);
            var from = Path.Join(name, @"build\.NETFramework\v4.5\");
            var to = @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5";
            FileSystem.CopyDirectory(from, to, UIOption.AllDialogs);
        }

        private static string DateTimeToFileString(DateTime d)
        {
            return d.ToString("yyyy-dd-M--HH-mm-ss");
        }

        private static async Task DownloadFile(string fileName, string url)
        {
            var uri = new Uri(url);
            HttpClient client = new HttpClient();
            var response = await client.GetAsync(uri);
            using (var fs = new FileStream(
                fileName,
                FileMode.CreateNew))
            {
                await response.Content.CopyToAsync(fs);
            }
        }
    }
}

In my case I needed to download 4.0 AND 4.5, so here is the code that downloads both 4.0 and 4.5:

using Microsoft.VisualBasic.FileIO;
using System.IO.Compression;

namespace j.Dev
{
    /// <summary>
    /// Example Usage: await DevHelpers.DownloadAndCopyFramework4_0And4_5();
    /// </summary>
    public class DevHelpers
    {
        public static async Task DownloadAndCopyFramework4_0And4_5()
        {
            await DownloadAndCopyFramework4_0();
            await DownloadAndCopyFramework4_5();
        }

        public static async Task DownloadAndCopyFramework4_5()
        {
            await DownloadAndCopyFrameworkGeneric("net45", "v4.5", "1.0.2");
        }

        public static async Task DownloadAndCopyFramework4_0()
        {
            await DownloadAndCopyFrameworkGeneric("net40", "v4.0", "1.0.2");
        }

        public static async Task DownloadAndCopyFrameworkGeneric(string netVersion, string folder, string nugetVersion)
        {
            var name = netVersion + "-" + DateTimeToFileString(DateTime.Now);
            var fileName = $"{name}.zip";
            var url = $"https://www.nuget.org/api/v2/package/Microsoft.NETFramework.ReferenceAssemblies.{netVersion}/{nugetVersion}";
            await DownloadFile(fileName, url);
            ZipFile.ExtractToDirectory(fileName, name);
            var from = Path.Join(name, @"build\.NETFramework\" + folder);
            var to = @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\" + folder;
            FileSystem.CopyDirectory(from, to, UIOption.AllDialogs);
        }

        private static string DateTimeToFileString(DateTime d)
        {
            return d.ToString("yyyy-dd-M--HH-mm-ss");
        }

        private static async Task DownloadFile(string fileName, string url)
        {
            var uri = new Uri(url);
            HttpClient client = new HttpClient();
            var response = await client.GetAsync(uri);
            using (var fs = new FileStream(
                fileName,
                FileMode.CreateNew))
            {
                await response.Content.CopyToAsync(fs);
            }
        }
    }
}