I am unable to build for .NET Framework 4.5 in Visual Studio 2022

<< Click to Display Table of Contents >>

Navigation:  Gnostice Document Studio .NET > Frequently Asked Questions (FAQs) > Building and Deployment >

I am unable to build for .NET Framework 4.5 in Visual Studio 2022

Visual Studio 2022 doesn't ship with the targeting pack for building .NET Framework 4.5 apps since .NET Framework 4.5 is longer supported by Microsoft. Unless you already have the targeting pack installed on your machine you will see build errors when referencing Gnostice libraries. Here are some options to overcome this issue.

 

Option 1: Install Visual Studio 2019. This will enable support for building even in Visual Studio 2022.

 

Option 2: Download the Windows 8 SDK from here and when installing it choose the option to install .NET Framework 4.5.

 

Option 3: Follow the steps below to manually copy over the targeting pack to your machine.

 

1.Download Microsoft.NETFramework.ReferenceAssemblies.net45 from NuGet

2.Open the package as a zip file

3.Copy the files from build\.NETFramework\v4.5 folder to Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5