TFS构建定义被覆盖 [英] TFS Build definition getting overwritten

查看:85
本文介绍了TFS构建定义被覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

     我在TFS 2017构建服务器中配置了一个新的TFS构建定义,其价格低于


    构建参数


    / p:DeployOnBuild = true / p:VisualStudioVersion = 12 / p:PublishProfile = Release


    /p:PackageLocation=$(build.artifactstagingdirectory). 我的解决方案是


   在构建服务器和artefact成功构建在"a"文件夹中创建。


 


   在构建服务器中为VS 2015安装SQL Server数据工具17.0之后我的


   即使构建仍然成功,构建也不会产生伪影。当我


   检查构建日志我发现了一个额外的构建参数


    /p:VisualStudioVersion=14.0。此参数在日志中不可用


   在SQL Server数据工具安装之前。这将覆盖VS版本12并构建


   在VS版本14.我的命令日志看起来像这样


    "C:\Program Files(x86)\ MSBuild\14.0\bin\msbuild.exe" "D:\\\\\\\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ < sln的路径>" / nologo


    ..................。


    ......................


    / p:DeployOnBuild = true


    /p:VisualStudioVersion=12.0


    / p:PublishProfile = Release


    / p:PackageLocation = D:\\\ tntant \_work\3 \ a


    / p:platform =" any cpu"


    / p:configuration =" release"


    /p:VisualStudioVersion="14.0"


   当我通过删除 手动运行此功能时/p:VisualStudioVersion=14.0套餐


   得到了。有人可以解释这个价值如何加到


   参数以及如何避免此参数。我尝试卸载SQL


   服务器数据工具但没有帮助


 

解决方案

您好write2kcl,



感谢您在此发帖。



您说您在MSbuild参数中使用了  / p:VisualStudioVersion = 12,那么您是否在构建服务器上安装了Visual Studio 2013或Visual Studio 2015?如果您只在构建服务器上安装了Visual Studio 2013,请告诉我为什么要为VS 2015安装SQL Server数据工具


此问题可能是由视觉工作室版本的冲突。所以我建议您检查一下是否能找到< VisualStudioVersion> 14.0< / VisualStudioVersion>在项目的.csproj文件中,然后将其删除。另外,
可以在Build任务中将Visual Studio的版本指定为"Visual Studio 2013"​​,确保没有将其指定为最新版本:



如果你还在服务器上安装了VS2015,我想你可以在参数中指定/p:VisualStudioVersion=14.0以使用VS2015构建项目(还要在构建任务中将Visual Studio版本指定为Visual Studio 2015)。


注意:如果所有这些步骤无法帮助您解决问题,您可以在卸载数据工具后尝试重新配置构建代理。



最好的问候


Limitxiao Gao


     I configured a new TFS build definition in TFS 2017 build server with below

     build parameters

    /p:DeployOnBuild=true /p:VisualStudioVersion=12 /p:PublishProfile=Release

    /p:PackageLocation=$(build.artifactstagingdirectory).  My solution was

    building successfully in build sever and artefact got created in "a" folder.

 

    After installing SQL Server Data Tool 17.0 for VS 2015 in Build server my

    build is not generating artefact even though build is still success. When I

    check build logs I found an additional build parameter

    /p:VisualStudioVersion=14.0. This parameter was not available in logs

    before SQL Server Data Tool install. This overwrite VS version 12 and build

    in VS version 14. My command log looks like this

    "C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe" "D:\agent\_work\3\s\

    <Path to sln>" /nologo

    ……………….

    ………………….

    /p:DeployOnBuild=true

    /p:VisualStudioVersion=12.0

    /p:PublishProfile=Release

    /p:PackageLocation=D:\agent\_work\3\a

    /p:platform="any cpu"

    /p:configuration="release"

    /p:VisualStudioVersion="14.0"

    When I run this manually by removing  /p:VisualStudioVersion=14.0 package

    gets created. Can someone please explain how this value getting added to

    parameters and how is can I avoid this parameter. I tried uninstalling SQL

    Server Data Tool but no help

 

解决方案

Hi write2kcl,

Thank you for posting here.

You said you used  /p:VisualStudioVersion=12 in the MSbuild parameter, so did you install Visual Studio 2013 or Visual Studio 2015 on the build server? If you only installed Visual Studio 2013 on the build server, could you please tell me why did you install SQL Server Data Tool for VS 2015.

This issue may be caused by the conflict of visual studio version. So i suggest that you could check if you could find the <VisualStudioVersion>14.0</VisualStudioVersion> in the .csproj file of the project, then remove it. Also you could specify the version of Visual Studio in the Build task to "Visual Studio 2013", make sure you did not specify it to latest version:

And if you also installed VS2015 on the server, I think you could specify /p:VisualStudioVersion=14.0 in your parameter to use VS2015 to build your project(Also specify the Visual Studio Version in the build task to Visual Studio 2015).

Note: If all these steps cannot help you solve the problem, you could try to re-configure the build agent after you uninstall the data tool.

Best Regards

Limitxiao Gao


这篇关于TFS构建定义被覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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