I was getting this error because I had setup Windows on my D: drive (opposed to the C: drive).
My old installation had the 3.5 framework.
The fact that the path to the files is "hard-coded" probably had my apps looking at this old Windows installation, causing it to incorrectly error.
Also, whenever I tried to reinstall it detected it being already installed (probably because it was looking in the wrong location).
The error was because... one account didn't have access to this c: drive where these needed files were located.
Giving permissions to that account got rid of the IO problem.
I figured out the solution due to this post:
Description
Hello,
after installing Visual Studio "Orcas" on my
machine I noticed an error when creating a new WPF project: the default XAML
page displayed a "whoops" error mentioning that the required assemblies for the
Window and Grid class weren't referenced.
After further investigation I
found out that the path to the .NET Framework 3.5 files doesn't depend on the
HKLM\Software\Microsoft\Windows\CurrentVersion\ProgramFilesDir registry key to
get the program files folder but instead uses "C:\Program Files".
Because
of space issuses I recently changed this registry key to point to "D:\Programme"
(including lots of other changes that aren't interesting in this
case).
So the problem was that the project was created with a reference
to "D:\Programme\Reference
Assemblies\Microsoft\Framework\v3.0\PresentationFramework.dll" (respecting the
registry key) but the assembly was installed to "C:\Program Files\Reference
Assemblies\Microsoft\Framework\v3.0\PresentationFramework.dll" (not respecting
the registry key) which caused "Orcas" to struggle.
Copying all the files
from "C:\Program Files\Reference Assemblies\" to "D:\Programme\Reference
Assemblies\" solved the problem.