Targeting pack for .NET 4.5.2 not installed

C#.NetVisual Studio-2013

C# Problem Overview


When opening an already existing solution in Visual Studio, it says

> The C# project "..." is targeting ".NETFramework,Version=v4.5.2", which is not installed on this machine.

Screenshot error message

I have already tried

C# Solutions


Solution 1 - C#

Official list of all targeting packs: https://www.microsoft.com/net/targeting. Make sure you download the "developer pack", not "runtime".

Direct links to offline installers: 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2

This problem seems to affect Visual Studio 2013 and Visual Studio 2015. The targeting packs are included in Visual Studio 2017.

Outdated links:

First, choose option 1, "Change the target to .NET Framework 4.5"

Next, go to the project options of the affected project, select "Application" and then choose "Install other frameworks..." from the list of target frameworks:

Screenshot Change target framework

This brings you to a website where you can choose your version of Visual Studio and download the targeting pack (called developer pack).

Website screenshot

Solution 2 - C#

I had the same issue. When I loaded the project it always asked for the .NET framework 4.5.2 and I was not able to install it because it always said that it was already there.

What worked for me was to install the Microsoft .NET Framework 4.5.2 Developer Pack from https://www.microsoft.com/en-us/download/details.aspx?id=42637

Give it a try. It may work for you as well.

Solution 3 - C#

You need to download the .NET Framework 4.5.2 Developer Pack That link compile all the frameworks in one place

http://scottge.net/2015/07/04/a-complete-list-of-microsoft-sdks-for-download/

Solution 4 - C#

I had this issue with .NET 4.6.2 (VS2017) - I downloaded the Developer pack from the link provided by the error message and installed, but it didn't help.

But then I opened up the Programs and Features in Windows Control Panel, and selected to "Change" Visual Studio 2017. The installer contains a tab entitled "Individual Components", and in there I saw that Targeting Pack for 4.6.2 was not selected.

Selecting them and selecting "Modify" fixed the problem.

Solution 5 - C#

I faced the same problem. In spite of installing developer pack, problem did not seem to go away. I did a VS 2015 repair and voila it started working.

Solution 6 - C#

I was getting the same problem but downloading the NETFramework Targeting Pack didn't resolve the issue. I was prompted to change the version or download the correct version. Neither option worked. I could see .NET Framework in the registry, on the Visual STudio installer and on the turn programs on and off and verified they were there. Turns out Visual Studio 2017 Community and 2019 Community installed on c:Program Files. So it looks here for the framework files. C:\Program Files\Reference Assemblies\Framework.NETFramework\v????? For whatever reason the .NETFramework files all loaded here C:\Program Files (x86)\Reference Assemblies\Framework.NETFramework\v????? Once I copied one of the folders from x86 to the other, it worked and it was recognized and no more error. I searched but the best solution I found was to create a symbolic link from the one folder to the other. I didn't feel making a copy was a good long term solution. So I used mklink and linked the x86 folder to the other. Now it's working perfectly!

Solution 7 - C#

.NET framework is not the same as Targeting Pack. The later needs to be installed in order for Visual Studio to work properly.

Solution 8 - C#

For what it’s worth, after I installed the required Developer Pack, I had to restart Visual Studio before it was detected. Hope this helps someone.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionThomas WellerView Question on Stackoverflow
Solution 1 - C#Thomas WellerView Answer on Stackoverflow
Solution 2 - C#MAO - Diego RinconView Answer on Stackoverflow
Solution 3 - C#David FawzyView Answer on Stackoverflow
Solution 4 - C#komodospView Answer on Stackoverflow
Solution 5 - C#Vaishnavi SubramanianView Answer on Stackoverflow
Solution 6 - C#Diane WilliamsView Answer on Stackoverflow
Solution 7 - C#nliuView Answer on Stackoverflow
Solution 8 - C#BinkView Answer on Stackoverflow