gpt4 book ai didi

msbuild - 如何正确地将 msbuild 属性传递给另一个 msbuild 脚本?

转载 作者:行者123 更新时间:2023-12-02 16:11:08 31 4
gpt4 key购买 nike

我有一个 master.proj msbuild 脚本,它使用 MSBuild 任务构建多个项目。

这是一个典型的例子:

<Target Name="Log4PostSharp" DependsOnTargets="log4net">
<MSBuild Projects="Log4PostSharp\Log4PostSharp.sln" Properties="Configuration=$(Configuration)" />
</Target>

但是,我的问题是,如果在命令行上给出更多属性,它们不会传递给 MSBuild 任务。

有没有办法将命令行上给定的所有属性传递给 MSBuild 任务?

谢谢。

最佳答案

您必须在 Properties 属性中以以分号分隔的属性名称/值对列表的形式显式传递额外属性。这并不漂亮,但这是要走的路:

<Target Name="Log4PostSharp" DependsOnTargets="log4net">
<MSBuild Projects="Log4PostSharp\Log4PostSharp.sln"
Properties="Configuration=$(Configuration);
Platform=$(Platform);
OtherPropertyPassInCommandLine=$(PropertyValue)" />
</Target>

关于msbuild - 如何正确地将 msbuild 属性传递给另一个 msbuild 脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2955863/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com