How to (completely) uninstall Code Contracts Tool extension?

2.5k views Asked by At

I'm trying to get rid of Code Contracts Tools extension on my system. I've uninstalled it from "programs and functionalities" yet it still appears as an installed extension inside Visual Studio.

Any help would be appreciated.

2

There are 2 answers

4
Steven Liekens On BEST ANSWER

The uninstaller does not remove all files that are no longer needed. In particular, the actual VSIX files are never deleted:

  • codecontracts_project.png
  • codecontracts_SM.png
  • extension.vsixmanifest
  • license.rtf

These files seem to be a source of trouble when upgrading the tools to a newer version.

To completely uninstall the tools:

  1. Close all instances of Visual Studio to prevent file locks
  2. Remove the tools using the uninstaller listed under "Programs and Features"
  3. Delete the extension folder: <Visual Studio installation folder>\Common7\IDE\Extensions\Microsoft\CodeContracts
0
fossfool On

I know this is an old post, but if you stumble in here looking for a way to remove Code Contracts, this is what finally worked for me:

BEFORE DOING ANYTHING: Make sure all instances of Visual studio have been closed on the PC.

1) Uninstall Code Contracts using the Control Panel.

2) Delete the folder C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\CodeContracts.

3) Open the file C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\extensions.configurationchanged with windows note pad, and then click file > Save. Make sure you don't actually make any changes to the file. VS is looking for a change in the last modified date to refresh the extensions.

Now start Visual Studio and make sure the Code Contracts extension is gone from the extensions screen. Like others here I'd done step 1 and 2, and it wasn't working. I gleaned step 3 from from the following post on MSDN:

https://social.msdn.microsoft.com/Forums/en-US/17d132a3-d2e7-48be-bdca-b0b6421e544a/may-21-2014-release?forum=codecontracts