如何自定义 TFS2010 构建以在日志中打印消息

发布于 2024-09-26 05:50:51 字数 552 浏览 5 评论 0原文

我最近将我的解决方案之一从 SVN+CruiseControl 迁移到 TFS2010。我的构建定义使用默认模板。我想定制模板。由于我从未使用过工作流程,因此我决定首先在构建日志中打印一条简单的消息。为此,我在序列顶部添加了一个 WriteBuildMessage 活动作为其第一个活动,并为其指定了值 Hello World。然而,在保存它、在源代码管理中检查它、排队、完成新构建然后打开构建之后,我在“查看日志”、“摘要”选项卡或 msbuild 日志文件中的任何位置都看不到 Hello World 消息。我尝试将 WriteBuildMessage 活动放在工作流程中的不同位置,但它永远不会被打印。我可以确保我的构建定义指向正确的模板,但它似乎没有打印消息,就好像它从未在工作流程中运行 WriteBuildMessage 活动一样?

我是否遗漏了一些东西,或者 WriteBuildMessage 不是在日志中打印消息的正确活动 有什么想法吗?

问候,

纳比尔

I have recently migrated one of my solution from SVN+CruiseControl to TFS2010. My build definition is using the Defaul Template. And I would like to customise the template. Since I have never worked with workflows before I decided to start by printing a simple message in the build log. For this purpose, I have added a WriteBuildMessage activity right on the top of the sequence as its first activity and given it a value of Hello World. However after saving it, checking it in the source control, queuing, completing a new build and then opening the build, I do not see the Hello World message any where in the View Log, Sumary tab or msbuild log file. I have tried putting the WriteBuildMessage activity at different places in the workflow but it just never gets printed. I can ensure that my build definition is pointing to the correct template but it just doesn't seem to print the message, as if it has never run the WriteBuildMessage activities in the workflow?

Is there somethign I am mising or is WriteBuildMessage is not the correct activity to print a message in the log Any ideas?

Regards,

Nabeel

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

赴月观长安 2024-10-03 05:50:51

我通过 MSDN 论坛弄清楚了

  1. 如果您希望 WriteBuildMessage 的输出在默认日志记录级别中可见,则必须将 Importance 属性设置为 BuildMessageImportance.High
  2. WriteBuildMessage的默认Importance是Normal,这样就不会显示该消息。当您对构建进行排队时,在参数选项卡中,将 Loggong Verbosity 设置为 Diagnostic,然后将显示所有消息,但这会在构建日志中产生更多噪音。

http://social.msdn.microsoft .com/Forums/en/tfsbuild/thread/1a6bbc05-8bd3-40f5-ab38-667214e5fe01

I figure it out via MSDN forums

  1. If you want the output from WriteBuildMessage to be visible in the default logging level, you must set the Importance property to BuildMessageImportance.High.
  2. The default Importanceof WriteBuildMessage is Normal so that the message will not be displayed. When you queue a build, in the parameters tab, set Loggong Verbosity to Diagnostic and then all message will be showed, but this will create much more noise in the build log.

http://social.msdn.microsoft.com/Forums/en/tfsbuild/thread/1a6bbc05-8bd3-40f5-ab38-667214e5fe01

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文