I am trying to configure some properties that I use several times in my MSBuild script. I have the following properties section:
<PropertyGroup>
<BuildDependsOn>$(BuildDependsOn); MyAfterBuild </BuildDependsOn>
<SubstitutionsFilePath>$(ProjectDir)app.config.substitutions.xml </SubstitutionsFilePath>
<AppConfig>$(TargetPath).config</AppConfig>
<HostConfig>$(TargetDir)$(TargetName).vshost.exe.config</HostConfig>
</PropertyGroup>
When I run this, I get the following error:
The expression "@(TargetPath).config" cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists.
I do not understand this error, since using $(BuildDependsOn)and $(ProjectDir)works fine. And I know that the values ββare $(TargetXXX)generated properly, when I put them directly in the "Tasks" section below, they work fine.
Tristan
source
share