在TFS 2010或MSBuild的触发器的配置转型 [英] trigger config transformation in TFS 2010 or msbuild

查看:432
本文介绍了在TFS 2010或MSBuild的触发器的配置转型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图利用配置转换的中持续集成环境中。

I'm attempting to make use of configuration transformations in a continuous integration environment.

我需要一种方法来告诉TFS生成代理来执行转换。我是那种希望它会发现在配置转换文件(web.qa-release.config,web.production-release.config,等...)后,只是工作。但事实并非如此。

I need a way to tell the TFS build agent to perform the transformations. I was kind of hoping it would just work after discovering the config transform files (web.qa-release.config, web.production-release.config, etc...). But it doesn't.

我有一个TFS生成定义,建立正确的配置(QA释放,产量释放,等...),我有一个拿到这些定义中内置了一些特定的.proj文件,以及那些包含一些环境特定的参数如

I have a TFS build definition that builds the right configurations (qa-release, production-release, etc...) and I have some specific .proj files that get built within these definitions and those contain some environment specific parameters eg:

<PropertyGroup Condition=" '$(Configuration)'=='production-release' ">
    <TargetHost Condition=" '$(TargetHost)'=='' ">qa.web</TargetHost>
    ...
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='qa-release' ">
    <TargetHost Condition=" '$(TargetHost)'=='' ">production.web</TargetHost>
    ...
</PropertyGroup>

我知道,从正确的配置,正在兴建的输出。现在我只需要学习如何触发配置转换。有一些骗人pocus,我可以添加到最终.proj在构建揭开序幕的变换和吹走个别转换文件?

I know from the output that the correct configurations are being built. Now I just need to learn how to trigger the config transformations. Is there some hocus pocus that I can add to the final .proj in the build to kick off the transform and blow away the individual transform files?

推荐答案

所有你应该需要做的是设置它的配置应该在TFS中使用的构建定义。

All you should need to do is setup which configuration should be used within the TFS build definition.

  1. 转到团队资源管理器>构建
  2. 编辑您的构建定义(或创建新的)
  3. 在过程的步骤有对配置,以打造设置。

在我来说,我已经建立了专门的配置为CI认为然后执行正确的web.config文件转换。确保您已添加了CI转换文件,你应该是好去。

In my case I have setup a configuration specifically for CI that then performs the correct web.config transformations. Ensure that you have added the "CI" transform file and you should be good to go.

这篇关于在TFS 2010或MSBuild的触发器的配置转型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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