-1

Could someone shed some light on how to use the DotNet.Contracts NuGet package in Visual Studio 2015 and 2017? Is it the only component required to use Code Contracts in Visual Studio???

Do I still need to install Contracts.devlab9ts.msi??? When trying to install Contracts.devlab9ts.msi, I got error 'Extensions' is not a valid short file name. This occurs on my Windows 10 dev machine, with latest Windows updates.

If we still need to install Contracts.devlab9ts.msi, what's the purpose of the NuGet package?

user2106007
  • 697
  • 1
  • 7
  • 11
  • Installing Contracts.devlab9ts.msi (v1.10.20606.1) on Windows 7 Pro works. Looks like latest Windows 10 updates is causing the "'Extensions' is not a valid short file name" error. – user2106007 Dec 03 '16 at 16:36

1 Answers1

0

You just need to install the DotNet.Contracts NuGet Package in your project, because this package contains all Code Contracts related files.

Please refer to: https://github.com/Microsoft/CodeContracts/issues/13

The Contracts.devlab9ts.msi could be installed on my Windows 10 build 10240 successful. If you still want to install Contracts.devlab9ts.msi for your Visual Studio, please check your Windows 10 version and make sure your Windows 10 dev has installed all updates.

Weiwei
  • 3,674
  • 1
  • 10
  • 13
  • Thank you Wendy. I will give it a try and reply back to this thread. However I am having trouble uninstalling Contracts.devlab9ts.msi (v1.9.10714.2) that I have been using for a while. I got "'Extensions' is not a valid short file name" on my dev machine (64-bit Windows 10 Enterprise). Is there a way to uninstall the older version? – user2106007 Dec 06 '16 at 14:42
  • I tried the NugGet package on a 64-bit Windows 7 Pro with VS2015, alone without installing Contracts.devlab9ts.msi. It doesn't seem to be working, and I don't even see the "Code Contracts" tab on my test project's property page. Is there anything I missed? – user2106007 Dec 06 '16 at 15:06
  • You can install the latest version(V1.10.20606.1) Contracts.devlab9ts.msi file to override the old version directly. If you want to uninstall the Contracts.devlab9ts.msi, you could update it to the latest version and then uninstall it because there has some problem on your old version. – Weiwei Dec 07 '16 at 08:39
  • The msi file is point to Visual Studio and the NuGet package is aim at your project. If you want to use "Code Contracts" tab on VS, you need to install the msi file, then restart your VS. If use the Code Contracts tools and functions in your project, you need to install the package and call them from your code. – Weiwei Dec 07 '16 at 08:39
  • Thank you Wendy. I only installed Contracts.devlab9ts.msi (V1.10.20606.1) and code contracts seems to be working, the way I have been using the older version. – user2106007 Dec 08 '16 at 16:10
  • By the it works only with VS2015. "Code Contracts" tab is not showing in VS2017 even both the msi file and NuGet package are installed. **Does VS2017 RC support code contracts? Or we need to wait for an update?** – user2106007 Dec 08 '16 at 17:53
  • The "Code Contracts" tab is also not showing in VS2017 on my machien. And according to the introduce for Code Contractes https://marketplace.visualstudio.com/items?itemName=RiSEResearchinSoftwareEngineering.CodeContractsforNET , it supports VS2010 to VS2015, which is not include VS2017. – Weiwei Dec 09 '16 at 05:06
  • You are welcome. If the answer is helpful and help you resolved your questions, please mark it. It is benefit to other communities who has the same issue. – Weiwei Dec 12 '16 at 02:05
  • **Wendy, will the final release of VS2017 support code contracts?** – user2106007 Mar 04 '17 at 03:59