I am a huge fan of the Code Contracts library which is now part of .net, in fact when I setup a new instance of VS it is one of the first plugins I install by default. However, I was having some issues because even though I had installed the .msi I was not able to get the settings tab to show up in VS2012, in fact it was not in VS2010 either. This was a bit odd to me because I had never had this issue.
In order to try to resolve this I decided I should uninstall the .msi and re-install it, so I set out to do this. However, after doing this I still did not have the tab in either IDE, now I was perplexed. Of course the first thing I did was to go out and search for the solution for this issue but nothing really popped out as ‘this is how to fix this issue’, however a few people did mention that they had to do a VS Repair install. I thought this to be a bit extreme so I was not too keen to give this a try.
However, as fate would have it I was kinda forced to do a Repair a few hours after tabling my efforts to get the tab to show in the IDE (I had some really odd VSMon debugger attachment issues and the error dialog actually suggested I do a repair). Given that I had 2 different issues both suggesting I do a repair install I figured WTF might as well do it.
Long story short, I did the repair install and BOTH my issues were resolved. I had the tab in the IDE and my VSMon debugger issues were gone. Now I don’t know if the issues were related or if it was just a really good coincidence but either way my issues were resolved.
So if you find yourself unable to get the Code Contracts tab showing in your IDE after installed the .msi try doing a VS repair install and see if that does the trick.
Till next time,
P.S. I have both VS2010 and VS2012 on my box and I installed VS2012 first. This may have caused some of the issues, not sure.
09-07-2012 5:38 AM