假设有以下内容..
<?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
(顺序不重要,只需两个ItemGroups的完整笛卡尔积)