1
我試圖執行以下目標,但以circular dependency
錯誤結束。我有一個停止條件$(Value) > 0
在目標Recursive
:如何遞歸執行MSBuild目標?
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<Target Name="Recursive" Condition="$(Value) > 0">
<PropertyGroup>
<Value>$([MSBuild]::Subtract($(Value), 1))</Value>
</PropertyGroup>
<MSBuild Projects="$(MSBuildProjectFile)" Targets="Display" />
</Target>
<Target Name="Display">
<Message Text="Value: $(Value)" />
<MSBuild Projects="$(MSBuildProjectFile)" Targets="Recursive" />
</Target>
<PropertyGroup>
<Value>10</Value>
</PropertyGroup>
<Target Name="Build">
<MSBuild Projects="$(MSBuildProjectFile)" Targets="Display" />
</Target>
</Project>
哇。非常感謝你。 – 2014-12-05 08:02:30