How to add an ItemList to a default ItemDefinitionGroup metadata in MSBuild?

自古美人都是妖i 提交于 2019-12-06 11:13:50

Ah, looks like I needed to add an extra layer of indirection to convert the ItemList to a Property. Then I could stick the property into the ItemDefinitionGroup.

The following code did the trick, wish there was a more direct way to do this though:

  <ItemGroup>
    <ForcedUsingFilesList Include="c:\path\to\files\*" />
  </ItemGroup>
  <PropertyGroup>
    <ForcedUsingFilesList2>
        @(ForcedUsingFilesList->'%(FullPath)')
    </ForcedUsingFilesList2>
  </PropertyGroup>
  <ItemDefinitionGroup>
    <ClCompile>     
      <ForcedUsingFiles>$(ForcedUsingFilesList2)</ForcedUsingFiles>
    </ClCompile>
  </ItemDefinitionGroup>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!