如何在一个构建目标中定义的值在其他目标中保持不变?如果 PropertyGroup 不是我应该在此处使用的正确 MsBuild 实体,那么是什么?ReleaseDir 在“Package”目标中正常打印,但在“DoPackage”中为空
<Target Name="Package">
<PropertyGroup>
<ReleasesDir>c:\tmp</ReleasesDirBase>
</PropertyGroup>
<Message Text="$(ReleaseDir)"/>
<CallTarget Targets="DoPackage" Condition="!Exists('$(ReleaseDir)')"/>
</Target>
<!-- Do the acutal packaging -->
<Target Name="DoPackage">
<Message Text="Creating package in '$(ReleaseDir)'"/>
<Error Condition="'$(ReleaseDir)' == ''" Text="No ReleaseDir defined"/>
<MakeDir Directories="$(ReleaseDir)"/>
...
</Target>