TeamCity 说要使用“构建参数";而不是“/property:"在 MSBuild 步骤中.这意味着什么? [英] TeamCity says to use "Build Parameters" instead of "/property:" in an MSBuild step. What does that mean?
问题描述
我有一个 TeamCity 服务器设置来执行我的 CI 构建.我正在构建和测试 C# 解决方案并运行一些自定义 MSBuild 任务.其中一项任务是在我的构建输出中打印警告...
I have a TeamCity server setup to do my CI builds. I'm building and testing a C# solution and running some custom MSBuild tasks. One of these tasks is printing a warning in my build output...
MSBuild 命令行参数包含/property:"或/p:"参数.请改用构建参数.
MSBuild command line parameters contains "/property:" or "/p:" parameters. Please use Build Parameteres instead.
我不明白这是什么意思或如何删除它.它不能很好地谷歌(有或没有错字).我从命令行运行任务(使用 /verbosity:diagnostic
)但它没有出现,所以我相信这是 TeamCity 消息.
I don't understand what this means or how to remove it. It doesn't Google well (with or without the typo). I ran the task from the command line (with /verbosity:diagnostic
) and it doesn't appear, so I believe it's a TeamCity message.
MSBuild 任务是
The MSBuild task is
<Target Name="InstallDb">
<MakeDir Directories="$(DbPath)" />
<Exec Command="sqlcmd -S .sqlexpress -i dbOmnyxDatabaseDrop.sql" />
<Exec Command="sqlcmd -S .sqlexpress -i dbOmnyxDatabaseCreate.sql -v DbPath="$(DbPath)"" />
<Exec Command="sqlcmd -S .sqlexpress -i dbOmnyxDatabaseProgrammability.sql" />
</Target>
而相关的TeamCity步骤信息是
And the relevant TeamCity step information is
MSBuild 版本:4.0
MSBuild 工具版本:4.0
运行平台:x64
目标:InstallDb
命令行参数:/property:DbPath=%env.DB_PATH%
MSBuild version: 4.0
MSBuild ToolsVersion: 4.0
Run platform: x64
Targets: InstallDb
Command line parameters: /property:DbPath=%env.DB_PATH%
推荐答案
你要添加 Build Parameters
下Properties and environment
配置中的变量
You have to add Build Parameters
under Properties and environment
variables in the configuration
`
因此,在 MSBUild 的 Build Step
的命令行参数中,删除指定为 /p:
的所有属性,并将每个属性添加到 构建参数
(上面的截图)并给出值
So in the command line parameters in the Build Step
for MSBUild, remove any property that is specified as /p:
and add each of those to the Build Parameters
( screenshot above) and give the values
这篇关于TeamCity 说要使用“构建参数";而不是“/property:"在 MSBuild 步骤中.这意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!