1

Essentially, what I want to do, is to be able to write my program commandline within the msbuild file itself. This could have many advantages, like being able to use different commandline depending on $Conditions and being able to have them saved directly in the .csproj for posterity and version control.

Is it possible? Pseudo code:

<Commandline>
/test=test /Name=test /Mode=whatever /lotsMore=more,more
</Commandline>

Then the .csproj this is in, should be using this commandline when executed.

4

1 回答 1

0

MsBuild 遥遥领先。这些命令行参数中的大多数都转换为 msbuild 项目文件中的属性,因此您可以作为替代方法创建条件属性组。

<PropertyGroup>
    <Name>Default Name</Name>
    <Mode>Default</Mode>
    <Test></Test>
</PropertyGroup>

<PropertyGroup Condition="$(Test)=='true'">
    <Name>Test</Name>
    <Mode>Whatever</Mode>
    <Test>test</Test>
</PropertyGroup>
于 2013-06-12T23:01:26.937 回答