C
C#2y ago
sparr

Interpolating a csproj xml property in the text of another property?

<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
<DataFolder>Win64_Data</DataFolder>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\$(DataFolder)\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
<DataFolder>Win64_Data</DataFolder>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\$(DataFolder)\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
Is something like this possible? I'm hoping I've just missed some available syntax for doing this sort of interpolation.
1 Reply
sparr
sparr2y ago
is there a way I can get msbuild to spit out the result? I'm testing and it doesn't seem to work, but there could be something else wrong adding that target to my <Project> has no obvious effect. some message appears nowhere in the output of msbuild ok, I have my msbuild output (without your target) in that viewer aha! thanks, that lets me find the interpolated HintPath it looks good, so my problem must be elsewhere