I installed Visual Studio 2010 Premium on my Windows 7 workstation. After loading a test C++ project, I noticed that it could not locate iostream. I took a look in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include and noticed that only two files exist here, srv.h and wmiatlprov.h

I installed the VS2010 product on a test virtual machine, and this directory (...\VC\include) is filled with the usual collection of folders and headers (the materials you'd expect to find in the includes directory.)

I have taken the following steps to rectify the missing headers on the problem workstation:

Verified that I have no A/V software active (I am using MS Security Essentials, realtime is disabled)

Uninstalled Visual Studio 2010 Premium and all other sub-products from Programs & Features

Ran the VS2010 Uninstall Tool with the /full and /netfx parameters

Deleted the Visual Studio 10.0 directories from both Program Files and Program Files (x86)

My experience today is more or less the same. I had VS2010 Premium installed, but didn't use it much, and for some reason the bundled SDK in it was broken. I uninstalled it, trying hard to get all removed, and then installed VS2010 Professional. (And applied Windows Upodates, SP1, Updates again.) Now the SDK seems OK, but no C library headers...
–
tmlNov 30 '12 at 13:48

Remove any parent keys VisualStudio\10.0\VC\Libraries, or similar (note the version number 10.0, which corresponds to 2010). Delete all of these registry paths. The search for the PaddedVersion key is just to ease up this search.

Install Visual Studio 2010.

Install Visual Studio 2010 SP1.

This solution may not be minimal, but it works for me. Hopefully others can confirm. The important difference here is that it is not just the HKEY_LOCAL_MACHINE from which the registry path must be deleted, as indicated in the link above.

The Visual Studio installer is a fickle beast, to put it mildly. The generic diagnostic is that your registry is dirty, having a record of a sub-component of VS installed while it is not actually present anymore. There are a lot of sub-components and an enormous number of registry entries that keep track of their install state and their config. Finding such a dirty key back is a serious needle-in-a-haystack problem.

This kind of registry damage is very common if you ever had a beta or RC edition installed. I never had a beta version that didn't give me an enormous problem getting the RTM version installed. The VS2010 beta went particularly badly for me, albeit that I shot my foot badly by updating to Windows7 without uninstalling the beta. A gigantic mess, to put it mildly. You can expect similar kind of upheaval of you ever had an un/install that didn't complete. And of course registry damage is always around to turn this into misery.

The problem is quite common, there are Visual Studio cleanup tools around that aim to purge the registry after something like this happened. For VS2010 there are actually several. Google "vs2010 uninstall utility" to find them. No idea if they are different someway, no reason I can think of to not just run them all.

Chips are seriously down when that still doesn't fix the problem. Only thing left is to dig through the dd*.txt files that are left in the TEMP directory after an install. They contain a detailed trace of the installer's decisions. Beware that you'll drown in the amount of data.

Thanks! I also suspect a dirty registry. The uninstall utility doesn't work, unfortunately, as OP already wrote. I'm looking for someone who is willing to dive into this and see what exactly is wrong (possibly in the registry), so that everyone having this issue area able to fix it. Steps to reproduce for me were to install VS2010 pro with SP1, uninstall it, and install VS2010 premium.
–
DanraJan 16 '13 at 16:58

You are going to have to do this "diving" by yourself, nobody has the exact same registry mess as you do, if any. If you don't want to tackle this then contact Microsoft Support for help. They'll walk you through it from their prior support case record. Being on the phone is important, so they can recommend alternate steps quickly, this just can't work through a web site.
–
Hans PassantJan 16 '13 at 17:10

Hans, I really appreciate your help, but your comment just isn't constructive. I've already mentioned a lot of people have this issue, and described steps to reproduce. Since many people have reported the same issue, it's likely many people DO have the same registry mess. It's quite assertive to say that I would have to either dive myself or ask Microsoft, and that absolutely no-one here on SO can assist. I set a bounty because I'm curious if someone can.
–
DanraJan 16 '13 at 23:55

Hmya, I asserted that being on the phone with an expert is required when all the normal workarounds don't produce results. I don't see a lot of other SO users dive in to help you, in spite of the bounty and a question that's been around for 4 months already. SO isn't supposed to be a personal help forum anyway, nor is it a substitute for the kind of help you can get from the product vendor. We can only hope to solve some of the problems out there on a site like this. Hopefully this answer does, for some users.
–
Hans PassantJan 21 '13 at 19:45

I tried several rounds of uninstalling and reinstalling. The hack that finally worked was to copy the entire contents of the VC folder from a machine with a working VS 2010 installation. You probably don't need to copy all of these , but I was missing 3000+ files in include, lib, and other folders within VC.

Yeah. I did the same thing and hope everything will work well. This issue is terrible! Reformating was not a serious option. I tried to look in the %TEMP% log files, but I wasn't able to figure out what the problem was. If it can be of any help, I also have VS2008 and VS2012 installed on the same box. I also have some Windows SDKs arounds. Maybe it's related.
–
Simon MourierApr 4 '13 at 15:31

I ran into this problem on Windows 8.1 when the VS 2010 Web installer failed to install correctly the first time. I followed Kaba's steps above with a slight difference and it solved the problem for me (so kudos to Kaba). The difference is that I deleted all the “VisualStudio\10.0” keys and all its sub-keys, as well as the “VisualStudio\10.0_Config” and sub-keys.