【发布时间】:2009-08-19 09:47:49
【问题描述】:
我正在尝试设置一些在我的 MSBuild 脚本中多次使用的属性。我有以下属性部分:
<PropertyGroup>
<BuildDependsOn>$(BuildDependsOn); MyAfterBuild </BuildDependsOn>
<SubstitutionsFilePath>$(ProjectDir)app.config.substitutions.xml </SubstitutionsFilePath>
<AppConfig>$(TargetPath).config</AppConfig>
<HostConfig>$(TargetDir)$(TargetName).vshost.exe.config</HostConfig>
</PropertyGroup>
当我运行它时,我收到以下错误:
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.
我不明白这个错误,因为使用 $(BuildDependsOn) 和 $(ProjectDir) 工作正常。而且我知道$(TargetXXX) 值会正确生成,因为当我将它们直接放入下面的任务部分时,它们可以正常工作。
【问题讨论】:
标签: msbuild