Update April 2016 - for VS2013+
Microsoft started to address the issue in late 2015 by releasing VisualStudioUninstaller.
They abandoned the solution for a while; however work has begun again again as of April 2016.
There has finally been an official release for this uninstaller in April 2016 which is described as being "designed to cleanup/scorch all Preview/RC/RTM releases of Visual Studio 2013, Visual Studio 2015 and Visual Studio vNext".
Original Answer - for VS2010, VS2012
Note that the following two solutions still leave traces (such as registry files) and can't really be considered a 'clean' uninstall (see the final section of the answer for a completely clean solution).
Solution 1 - for: VS 2010
There's an uninstaller provided by Microsoft called the Visual Studio 2010 Uninstall Utility. It comes with three options:
- Default (VS2010_Uninstall-RTM.ENU.exe)
- Full (VS2010_Uninstall-RTM.ENU.exe /full)
- Complete (VS2010_Uninstall-RTM.ENU.exe /full /netfx)
The above link explains the uninstaller in greater detail - I recommend reading the comments on the article before using it as some have noted problems (and workarounds) when service packs are installed. Afterwards, use something like CCleaner to remove the leftover registry files.
Here is the link to the download page of the VS2010 UU.
Solution 2 - for: VS 2010, VS 2012
Microsoft provide an uninstall /force feature that removes most remnants of either VS2010 or VS2012 from your computer.
MSDN: How to uninstall Visual Studio 2010/2012. From the link:
Warning: Running this command may remove some packages even if they are
still in use like those listed in Optional shared packages.
- Download the setup application you used to originally install Visual Studio 2012. If you installed from media, please insert that media.
- Open a command prompt. Click Run on the Start menu (Start + R). Type cmd and press OK (Enter).
- Type in the full path to the setup application and
pass the following command line switches:
/uninstall /force
Example:
D:vs_ultimate.exe /uninstall /force
- Click the Uninstall button and follow the prompts.
Afterwards, use something like CCleaner to remove the leftover registry files.
A completely clean uninstall?
Sadly, the only (current) way to achieve this is to follow dnLL's advice in their answer and perform a complete operating system reinstall. Then, in future, you could use Visual Studio inside a Virtual Machine instead and not have to worry about these issues again.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…