如何使用TeamCity将此公共属性传递给MSBuild? [英] How do I pass this common property to MSBuild using TeamCity?

查看:123
本文介绍了如何使用TeamCity将此公共属性传递给MSBuild?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用TeamCity Visual Studio运行程序.我想添加一个无法从Visual Studio访问的设置.

I am using the TeamCity Visual Studio runner. I want to add a setting that is not accessible from Visual Studio.

/Property:FileAlignment=4096

我将其直接输入到构建步骤命令行参数"中.生成日志显示错误:

I typed that directly into the build step "Command line parameters." The build log shows the error:

MSBuild命令行参数包含"/property:"或"/p:"参数.请改用Build Parameters.

MSBuild command line parameters contains "/property:" or "/p:" parameters. Please use Build Parameters instead.

我不知道如何从TeamCity将其提供给MSBuild并摆脱此警告!

I don't understand how to provide this to MSBuild from TeamCity and get rid of this warning!

共有3种:

  • 配置参数
  • 系统属性
  • 环境变量.

我不想要环境或系统变量,因为我不希望此构建依赖于任何外部变量.我现在要尝试Config,但是我不确定我是否在正确地填写它.

I don't want an environment or system variable because I don't want this build to depend on anything external. I am going to try Config right now, but then I'm not sure I'm filling it in right.

在其程序中似乎仅具有可导航/可折叠的类似xml的级别的生成日志,没有说明生成参数.

The build log, which seems only to have navigable/foldable xml-like levels with their program, did not say the build parameters.

推荐答案

此问题已解决.为了澄清,Anthony告诉了如何使用MSBuild在命令行中解决问题.也可以使用devenv在命令行上解决该问题,对于Microsoft的每张票证,其语法为:

This was solved. To clarify, Anthony told how to solve the problem in the commandline using MSBuild. It can also be solved on the commandline using devenv, per a ticket with Microsoft, the syntax is:

 devenv ..\..\mysolution.sln /Rebuild /Property:Config=Release;Platform=AnyCPU;Filealignment=512

但是,我想要获得Teamcity的"Visual Studio Build"来接受参数.这是如下实现的.在命令行参数"框中,输入:

What I wanted, however, was to get Teamcity's "Visual Studio Build" to accept the parameter. This was achieved as follows. In the box for Command line parameters, I entered:

/Property:FileAlignment=filealignment v:diag

然后,构建参数"的输出选项卡显示:

Then the output tab for Build Parameters shows:

User Defined Parameters
Name                    Value passed to build
system.filealignment    512
system.verbosity        diagnostic

这篇关于如何使用TeamCity将此公共属性传递给MSBuild?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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