鉴于这样的事情..
<?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)... -->
<Message Text=" %(Combined.ConfigFile) %(Combined.Database) " />
</Target>
</Project>
我希望输出是这样的..(给定两个文件 one.config 和 two.config)
one.config DB1
two.config DB1
one.config DB2
two.config DB2
(顺序不重要,只是两个 ItemGroup 的全笛卡尔积)