代码合同打破MSBuild(vs2010 RTM) [英] Code contracts breaks MSBuild (vs2010 RTM)

查看:86
本文介绍了代码合同打破MSBuild(vs2010 RTM)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

安装代码合同(在26/05/2010下载,msi为Contracts.devlab9std.msi)后,使用MSBuild构建项目不再有效。所有.csproj项目都失败并出现以下错误:

After installing code contracts (downloaded on 26/05/2010, the msi is Contracts.devlab9std.msi), building projects with MSBuild no longer works. All .csproj projects fail with the following error:

 

C:\Program Files(x86)\ MSBuild\4.0\Microsoft.Common.targets\ImportAfter\CodeContracts.targets(2,3):导入的项目 " C:\ MsBuild \v4.0 \ Microsoft .CodeContracts.targets"没找到。确认< Import>中的路径声明是正确的,
并且该文件存在于磁盘上。

C:\Program Files (x86)\MSBuild\4.0\Microsoft.Common.targets\ImportAfter\CodeContracts.targets(2,3): The imported project "C:\MsBuild\v4.0\Microsoft.CodeContracts.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

 

我的C盘上没有MsBuild目录;看起来有人硬编码从他们的开发机器到发布的路径......

I have no MsBuild directory on my C drive; it looks like someone hardcoded the path from their dev machine into the release...

 

我卸载了合同,问题就消失了。这很难过,因为我现在想调查.NET 4出来的合同: - (

I uninstalled contracts and the problem went away. This is sad, as I would have liked to investigate contracts now that .NET 4 is out :-(

推荐答案

嗯,你呢?环境变量设置是否覆盖安装程序集CodeContractsInstallDir?

Hmm, do you have environment variables set that override the installer set CodeContractsInstallDir ?

 


这篇关于代码合同打破MSBuild(vs2010 RTM)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆