Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Contracts version does not update

I've installed an update of Code Contracts but the version of Code Contracts shown in the "Extensions and Updates" window has not changed. However in project properties, the version number has changed.

Why is the current version in "Extensions and Updates" not changing and how I can fix it?

If it helps: I use Windows 7 Enterprise and Visual Studio Professional 2013

EDIT:

  • I restarted program and computer.
  • I have just installed Visual Studio 2013. I do not install older versions of Visual Studio.
  • On "Code Contracts" tab in project properties I see a new version number. And I think that the Code Contracts libraries are updated.
  • I tried to remove and reinstall Code Contracts. It doesn't help. But I don't want reinstall Visual Studio.

EDIT 2:

Extensions and Updates: Extensions and updates

Project properties: Project properties

like image 488
Vlad Avatar asked Dec 19 '14 09:12

Vlad


2 Answers

This seems to be an issue with the uninstaller as described in this MSDN forum thread by user Manuel Pallier

Check if you have two folders in C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\CodeContracts, one with the old version number and one with the new one.

Follow these steps to clean-up all versions and then reinstall the correct version of Code Contracts:

  1. Uninstall Code Contracts via the control panel.
  2. Delete the folder C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\CodeContracts.
  3. Touch the file C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\extensions.configurationchanged (touching means updating its last modified date; just open it in an editor and save it without changes). This step is required so that Visual Studio rebuilds its extension database on the next start.
  4. Start Visual Studio and make sure the Code Contracts extension is gone from the extensions screen.
    4b. Click Uninstall if it hasn't (might be the case for 1.8.x -> 1.9.x)
    Then close Visual Studio again.
  5. Install the new version.
  6. Start Visual Studio and make sure it shows the new version in the extensions screen.

There is a similar answer on SO from user Steven Liekens that seems to confirm that the uninstaller is flaky.

Uninstalling Visual Studio seems NOT to be the way to solve so don't go down that route.

like image 196
rene Avatar answered Sep 18 '22 05:09

rene


Version 1.9.10714.2 seems to have a bad vsixmanifest file. I did all the above and then edited

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\CodeContracts\1.9.10714.2\extension.vsixmanifest and corrected the version number.
Re-touched the extensions.configurationchanged file and VS accepted that the version installed was upto date.
like image 43
Charles Cross Avatar answered Sep 18 '22 05:09

Charles Cross