如果在cs proj文件中未将SpecificVersion属性设置为false,则在服务器上构建失败 [英] Build fails on server if SpecificVersion property is not set to false in cs proj file

查看:954
本文介绍了如果在cs proj文件中未将SpecificVersion属性设置为false,则在服务器上构建失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


Visual Studio 2015 TFS。

Visual studio 2015 TFS.


我遇到过一种场景,如果下面提到的属性没有设置为false,如果团队采用最新代码并在本地构建......没有人得到错误......构建成功对全部。但是,当我们在服务器上构建时,它会失败。

I have come across a scenarios where if below mentioned property is not set to false and if team takes latest code and builds locally... no one get error...build is successful for all. However, When we build on the server, it fails.

Proprty name: <SpecificVersion>False</SpecificVersion>
File name: Any cs project file



edit:此属性与我们在项目中引用的dll相关。

edit: This property pertains to the dll that we reference in the project.


如何避免这种情况?我们可以使用TFS中的任何设置或工具来验证所有这些设置,在签入时触发构建并在构建失败时发送通知吗?

How this can be avoided ? Can we use any settings or tool in TFS that will validate all such settings, trigger the build on check in and send notification if build fails?

AD

推荐答案

您好AD_16,

Hi AD_16,

您的构建服务器中的dll是否具有相同的版本和与本地机器相同的PublicKeyToken?

Did the dll in your build server has the same Version and the same PublicKeyToken as your local machine?

如果你设置< SpecificVersion> True< / SpecificVersion>,当你执行build时,构建系统将运行这些过程:

If you set <SpecificVersion>True</SpecificVersion>, when you execute build, the build system will run these process:


  • 构建系统找到它可能使用的物理程序集
  • 构建系统将物理程序集的版本与存储在.csproj文件中的程序集版本进行比较以获取程序集引用
  • 如果两个程序集版本完全相同,则解析过程成功,找到的物理程序集用于构建
  • 如果两个程序集版本不匹配,则物理程序集被丢弃并通过查找下一个可能的程序集继续解析过程

  • 如果找不到更多可能的物理程序集,则解析过程将失败。这会导致编译器警告(警告MSB3245),告诉您无法解析引用。

有关程序集引用的特定版本属性如何工作的详细信息请参阅这篇文章:

For more information of how specific version property of an assembly reference work please refer to this article:

http://stackoverflow.com/questions/24022134/how-exactly-does-the-specific-version-property-of-an-assembly-reference-work-i

最好的问候


这篇关于如果在cs proj文件中未将SpecificVersion属性设置为false,则在服务器上构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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