The problem: Visual Studio Professional 2013 does not seem to recognize that .Net 4, or 4.5 through 4.7 are installed on my computer. It does not show ANY of these in the 'target framework' drop-downs. And my previous C# project that was made for 4.5 no longer loads or compiles (it used to work, on the same machine).
It looks like this: Target drop-down
I've wasted over five days on this problem. I searched the internet and this site numerous times already and read carefully every single page that even remotely has to do with this problem. I tried literally dozens of things, some of them several times in a different order, and NOTHING helps:
Re-installing .NET, all versions I could find 4.5- 4.7 (yes the SDK versions as well as multi-target versions).
Uninstalling all .NET installations, using the .NET cleanup tool, using the .NET repair tool, manually going over every .NET folder and registry key I could find and deleting those, and then reinstalling .NET 4.5 SDK.
Reinstalling and repairing Visual Studio 2013, or manually deleting all Visual Studio files and folders everywhere on the drive, and then re-installing it.
Installing various Windows SDKs separately, and installing MSBuild 2015.
When I install the same VS2013 install on another fresh VM machine, it works fine. I tried comparing both machines for days and even copying whole .Net/SDK/MSBuild folders and registry branches from the good VM to my machine, but could not find what was missing or misconfigured.
I tried debugging it using ProcessMonitor and other tools/logic carefully for 2 days but could find anything that helped (there are many thousands of lines that have to do with .NET so this is an impossible task.)
I tried using "SET TRACEDESIGNTIME=true" and looking at the logs. But I could not figure out which of the many settings are important or missing. I did notice that "SDK40ToolsPath" was empty and I fixed that by setting these values in the command line which were also mis-configured:
SET MSBuildExtensionsPath=C:\Program Files (x86)\MSBuild SET MSBuildExtensionsPath32=C:\Program Files (x86)\MSBuild
And this seemed to do the trick for the path value, but still no .NET 4+ in VS. Perhaps there are other more basic properties I should be worrying about if SDK40ToolsPath wasn't set properly?
I am at my wits end and I hope that I do not have to reinstall Windows just for this because that would take another week. If anyone has any insight how VS detects .NET framework versions, or how to solve this problem, I would be most grateful.