dotnet/msbuild

Error MSB4012 could be more helpful

Open

#656 创建于 2016年5月26日

在 GitHub 查看
 (0 评论) (2 反应) (0 负责人)C# (1,364 fork)batch import
Area: Debuggabilityhelp wantedtriaged

仓库指标

Star
 (5,062 star)
PR 合并指标
 (平均合并 11天 7小时) (30 天内合并 125 个 PR)

描述

In the spirit of https://twitter.com/GregorySchier/status/732830868562182144, this could be improved:

error MSB4012: The expression "o:\msbuild\bin\Debug-NetCore\Windows_NT_Deployment\\@(ResolvedRuntimeFiles->'%(DestinationSubDirectory)')" 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.

"Use a semicolon" is a good suggestion (and should probably be the only one if there's no item transform involved), but there's another common case where you can run into this: when the solution is to move the initial string inside the item transform. We could suggest that rewriting as well:

error MSB4012: The expression "{0}" 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, or move {1} inside the item transformation to prefix every transformation output with the string.

贡献者指南