Friday, November 12, 2010

How to Uninstall Microsoft ASP.NET MVC 3 RC

Scott Guthrie 'blogged about some install problems some folks are having with our RC release of Microsoft ASP.NET MVC 3. One problem is that MVC 3 and the Async CTP do not work side-by-side. If you've installed both, you now need to uninstall both to get back into a state where you can install one or the other.


But uninstalling MVC 3 RC isn't as simple as uninstalling everything labeled 'ASP.NET MVC 3' in Programs and Features. MVC 3 RC also installs ASP.NET Web Pages (upon which it depends), NuGet, and a Visual Studio update that adds tools support for the Razor view engine. So, to completely uninstall MVC 3 RC, you actually need to uninstall all of the following:

  • Microsoft ASP.NET MVC 3
  • Microsoft ASP.NET MVC 3 - Visual Studio 2010 Tools (only installed when you have Visual Studio 2010)
  • Microsoft ASP.NET MVC 3 - VWD Express 2010 Tools (only installed if you have Visual Web Developer 2010 Express)
  • Microsoft ASP.NET Web Pages
  • Microsoft ASP.NET Web Pages - Visual Studio 2010 Tools (only installed when you have Visual Studio 2010)
  • Microsoft ASP.NET Web Pages - VWD Express 2010 Tools (only installed if you have Visual Web Developer 2010 Express)
  • NuGet
  • Update for Microsoft Visual Studio 2010 -  (KB2385361) (only installed when you have Visual Studio 2010)
  • Update for Microsoft Visual Web Developer 2010 Express -  (KB2385361) (only installed if you have Visual Web Developer 2010 Express)
N.B., the last two are installed as updates, not products; you'll need to switch to the 'View installed updates' section to uninstall them.

Windows 7 Walk-through

Here is a step-by-step walk-through of how to completely uninstall ASP.NET MVC 3 RC on Windows 7 (the steps and screens will differ on other versions of Windows, but the the idea, and actions you must take, are essentially the same):
  1. Open the Control Panel (Click Start, then click Control Panel)
  2. If you're in Category view, click 'Uninstall a program'; otherwise, click 'Program and Features'
  3. Uninstall everything that includes the phrase 'ASP.NET MVC 3'
  4. Uninstall everything that includes the phrase 'ASP.NET Web Pages'
  5. Uninstall 'NuGet'
  6. Switch to the 'View installed updates' section
  7. Uninstall everything that includes the phrase 'KB2385361'
ASP.NET MVC 3 RC should now be completely uninstalled.

Automating the Uninstallation

If you don't want to take all those manual steps, open a Visual Studio command prompt* with Administrator privilege and run all of the following commands (I suggest you copy and paste them):

  • wmic product where name="Microsoft ASP.NET MVC 3" call uninstall
  • wmic product where name="Microsoft ASP.NET MVC 3 - Visual Studio 2010 Tools" call uninstall
  • wmic product where name="Microsoft ASP.NET MVC 3 - VWD Express 2010 Tools" call uninstall
  • wmic product where name="Microsoft ASP.NET Web Pages" call uninstall
  • wmic product where name="Microsoft ASP.NET Web Pages - Visual Studio 2010 Tools" call uninstall
  • wmic product where name="Microsoft ASP.NET Web Pages - VWD Express 2010 Tools" call uninstall
  • wmic product where name="NuGet" call uninstall
  • msiexec /package {BC0464FA-A0BA-3E38-85BF-DC5B3A401F48} /uninstall {3069D446-63C5-38F4-9D28-41858024419C}
  • msiexec /package {85076DFF-7A17-3566-9CC0-488E6E6D4494} /uninstall {3069D446-63C5-38F4-9D28-41858024419C}
* if you don't know what a Visual Studio command prompt is, or how to open it, I suggest you use the manual steps.

I hope this helps.

Cheers,