I'm trying to add all the files in a given directory to the ClCompile metadata's ForcedUsingFiles parameter.
I'm using the following code:
<ItemGroup>
<ForcedUsingFilesList Include="c:\path\to\files\*" />
</ItemGroup>
<ItemDefinitionGroup>
<ClCompile>
<ForcedUsingFiles>@(ForcedUsingFilesList)</ForcedUsingFiles>
</ClCompile>
</ItemDefinitionGroup>
But I'm getting the error
The value "@(ForcedUsingFilesList)" of metadata "ForcedUsingFiles" contains an item list expression. Item list expressions are not allowed on default metadata values.
Any idea how I can work around this error?
Thanks