Rico Suter's blog.
 


Recently, I had the following compile error in a fresh Visual Studio 2015 installation on Windows 10. The project in question had Code Contracts enabled. The problem was a .targets file with an invalid path:

1>  The system cannot find the path specified.
1>C:\Program Files (x86)\Microsoft\Contracts\MsBuild\v14.0\Microsoft.CodeContracts.targets(296,5): 
  error MSB3073: The command ""C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\
  NETFX 4.6 Tools\sn.exe" /R "obj\Debug\MyToolkit.dll" "Default.snk"" exited with code 3.

To fix this problem, open the file

C:\Program Files (x86)\Microsoft\Contracts\MsBuild\v14.0\Microsoft.CodeContracts.targets

in Administrator mode and change

$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.6 Tools\sn.exe

To

$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\sn.exe

This problem should be fixed in the next release of Code contracts, check out this pull request.



Discussion