有没有办法遍历 MSBuild 文件的属性,以访问特定的每个属性的名称和值<PropertyGroup>
?也许是这样的:
<Project ToolsVersion="4.0" DefaultTargets="test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="testPropertyGroup">
<Property1>Value1</Property1>
<Property2>Value2</Property2>
</PropertyGroup>
<Target Name="prop">
<Message Text="Name=%(testPropertyGroup.Name)"/>
<Message Text="Value=%(testPropertyGroup.Value)"/>
</Target>
</Project>