The new definition of insanity: Trying to figure out why the heck Visual Studio can’t find a version of .NET that is installed on your computer.

I use VS2010 Pro for one project, and had downloaded VS2015 Community to test out for another project. Everyone was happy. Then I uninstalled VS2015. All hell broke loose.

My VS2010 projects wouldn’t recognize my .NET v4.0, and when I loaded the project’s property page, it wasn’t in the Target Frameworks dropdown. Downloaded every tool in the world confirming I had .NET v4.0 installed.

Fortunately, I had access to a remote computer with VS2010 and .NET v4.0 installed to compare the reference files. There were a couple issues.

First, at some point, the FrameworkList.xml was missing from my .NET v4.0 folder. This was in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\RedistList. I copied the file from the computer that was working to my computer, and bam! .NET v4.0 came up in my Visual Studio target frameworks. Unfortunately that wasn’t enough.

When I built my projects, I got a lot of ‘System not found’, ‘System.Data not found’ errors.  I nearly died.

Fortunately, with the help of my functioning computer, at some point the uninstallation had also deleted all the DLLs from the folder. In this case, Visual Studios error was informative. It couldn’t find those DLLs because they weren’t there.

Copying all the DLLs from C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0 to my local directory, the world seems to be back in order.

May God help you find this post if you have this same problem. It’ll help you avoid some insanity that I wasn’t so fortunate to avoid.

Hat tip to yagni.net for getting me down this path.

Advertisements