itemgroup

How to get all the metadata keys for any ItemGroup item?

孤人 提交于 2019-11-28 23:58:17
Is there a way to get all the metadata keys associated with a given item? I want to do something like the following. Given: <ItemGroup> <MyItems Include="item1"> <key1>val1</key1> <key2>val2</key2> <key3>val3</key3> </MyItems> <MyItems Include="item2"> <key4>val4</key4> </MyItems> </ItemGroup> Be able to determine that item1 has metadata available for key1, key2, and key3, and that item2 has metadata available for key4, without knowing what the names of those keys actually are. In effect, I'm trying to use the metadata to specify attributes that I have no idea about, and then trying to figure

Cross-Join ItemGroups in MSBuild

只谈情不闲聊 提交于 2019-11-28 01:16:37
问题 Given something like so.. <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <ConfigFiles Include="*.config" /> <DatabaseConfig Include="ABC"> <Database>DB1</Database> <CsString>Database</CsString> </DatabaseConfig> <DatabaseConfig Include="DEF"> <Database>DB2</Database> <CsString>Logging</CsString> </DatabaseConfig> </ItemGroup> <Target Name="test" > <!-- Some sort of join here (or somewhere)... -->

How to get all the metadata keys for any ItemGroup item?

[亡魂溺海] 提交于 2019-11-27 21:23:57
问题 Is there a way to get all the metadata keys associated with a given item? I want to do something like the following. Given: <ItemGroup> <MyItems Include="item1"> <key1>val1</key1> <key2>val2</key2> <key3>val3</key3> </MyItems> <MyItems Include="item2"> <key4>val4</key4> </MyItems> </ItemGroup> Be able to determine that item1 has metadata available for key1, key2, and key3, and that item2 has metadata available for key4, without knowing what the names of those keys actually are. In effect, I'm