0
votes

Background: Windows 8.1 .NET Framework up to v4.6.1 Visual Studio 2013 Update 5 VS Solution targeting .NET Framework 4.0 (due to environment limitations, can't be upgraded currently)

The solution was opening fine yesterday, I was able to work in it without issues. However, today when I open the solution I get a message saying The C# project .... is targeting ".NETFramework,Version=v4.0" which is not installed on this machine and it gives me options to 1 - Change the target to .NET Framework 4.5 (Not an option) 2 - Download the targeting pack for ".NETFramework,Version=v4.0". 3 - Do not load the project

Since I'm running Windows 8, downloading .NETFramework 4 won't do any good because it won't let me install it, it says to use the add features option (which I removed/readded this feature already today).

I have downloaded the .NET Repair Tool, the NETFX Setup Verifier (which verifies .NET 4 is installed correctly), and the .NET Cleanup Tool. None of these fix the issue.

Any ideas? It's a work laptop so upgrading to Windows 10 isn't a timely solution either.

Thanks in advance for the help.

1
It recommends the targeting pack, not the same thing as the .NET Framework. Targeting pack files are located in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\ .NETFramework\v4.0. You ought to be a lot more concerned about the health of the disk drive, those files don't just disappear. - Hans Passant
I just checked and verified there are targeting packs for all .NET versions in that directory: v3.5 v4.0 v4.0.3 v4.5 v4.5.1 v4.5.2 v4.6 v4.6.1 - jay

1 Answers

0
votes

Was able to fix the issue by running Repair on Visual Studio 2013. It found the Targeting Packs after that.