Getting a Clean Install of Visual Studio 2010 and the Win 7.1 SDK on Win 10 and Using It from Visual Studio 2019
I found this process extremely laborious and full of dead-ends. I had to combine several processes found on the internet into one procedure. This is probably missing a few steps. I hope it's helpful to people googling for this. If I'm missing steps please leave comments.
- Uninstall any existing
2010
-related packages (both x86 as well as x64) fromControl Panel
>Programs and Features
orAdd or Remove Programs
. Uninstall the components in the order laid out by this MSDN docs section. - Recursively delete all the following registry keys, if they exist:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\10.0
Computer\HKEY_USERS\.DEFAULT\Software\Microsoft\VisualStudio\10.0
Computer\HKEY_USERS\.DEFAULT\Software\Microsoft\VisualStudio\10.0_Config
Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\10.0
Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\10.0_Config
Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\VSCommon\10.0
- Download the Visual Studio 2010 Uninstall Utility and run it from an Administrator-elevated Command Prompt by running these commands:
cd %USERPROFILE%\Downloads
VS2010_Uninstall-RTM.ENU.exe /full /netfx
- Delete
C:\Program Files (x86)\Microsoft Visual Studio 10.0
andC:\Program Files\Microsoft Visual Studio 10.0
, if they exist. - Restart your computer.
- Carefully follow
CAM_344
's instructions on this SO post, in order to change your registryVersion
keys related to your computer's .NET framework. This is a hackish workaround that's needed because theWin 7.1 SDK Installer
checks that these registry values are in the4.0.x
range before allowing you to run it.- Temporarily replace the registry
Version
keys' values with4.0.30319
. - Make sure to write down the original values of the registry
Version
keys that you change. You'll need to revert back to the original values later.
- Temporarily replace the registry
- Download and run the Win 7.1 SDK Installer, except make sure to uncheck any components having
Visual C++ Compilers
and/orVisual C++ 2010
. - Download and run the Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows 7.1 SDK. This will installer the latest Win 7.1
Visual C++ Compilers
andVisual C++ 2010
components that you intentionally unchecked in the previous step. - Download and run the x64 Visual C++ 2010 Redistributable Installer and x86 Visual C++ 2010 Redistributable Installer.
- Back in
RegEdit
, restore the registryVersion
keys you changed back to their original values. - Restore the
Client
andFull
registry key-paths' ownership back to theNT SYSTEM\TrustedInstaller
.- TODO: For some reason, this doesn't work on my laptop. I probably have a corporate-level ActiveDirectory renaming of
TrustedInstaller
, or something like that.
- TODO: For some reason, this doesn't work on my laptop. I probably have a corporate-level ActiveDirectory renaming of
- Install
Visual Studio 2010 Professional
from my.visualstudio.com. Close all applications before running the installer. - Hit the Windows key on your keyboard then search for
Check for Updates
and hit Enter. This should take you to theWindows Update
panel. Click theCheck for Updates
button. This should discover and install theVisual Studio 2010 Service Pack 1
, along with other 2010-related updates. When all these updates are done, restart your computer. - Install the latest
Visual Studio 2019
from my.visualstudio.com. - If the
Visual Studio Installer
, click theModify
button in theVisual Studio 2019
section. Install any extra components you need, like MFC, etc. for old VS2010 GUI apps. - Now if you open a VS solution in VS2019 and that solution contains VS2010-targeting sub-projects (they should have
(Visual Studio 2010)
next to their names), then you should be able to run a right-click -->Clean
and right-click -->Build
on that solution, and it should find all the VS2010 header files and libraries just fine, assuming all the steps above worked correctly for you.- If you get an error like
cannot open database file vc100.pdb
, one more thing to try is to move your whole solution folder to your Desktop and do anotherClean
andBuild
. Sometimes corporate or personal antivirus software prevents VS from creating and copying PDB files unless they're somewhere under your%USERPROFILE%
directory, such as%USERPROFILE\Desktop
.
- If you get an error like