我想增加值 N,其中 n E {1...5}。如何使用 msbuild 增加 N 的值。因为我想做同样的操作 5 次。
那么我可以在 ms build 中循环吗?请帮我解决这个问题
我想增加值 N,其中 n E {1...5}。如何使用 msbuild 增加 N 的值。因为我想做同样的操作 5 次。
那么我可以在 ms build 中循环吗?请帮我解决这个问题
你可以这样做:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<ItemGroup>
<!-- Define value N where n E {1...5} -->
<VariableN Include="1"/>
<VariableN Include="2"/>
<VariableN Include="3"/>
<VariableN Include="4"/>
<VariableN Include="5"/>
</ItemGroup>
<!-- Testing target -->
<Target Name="Test">
<!-- Testing task. Task will be executed 5times. -->
<Message Text="VariableN = %(VariableN.Identity)"/>
</Target>
</Project>