dotnet / dotnet/msbuild

Error MSB4012 could be more helpful

Open
#656 0 comments 2 reactions 0 assignees View on GitHub
Area: Debuggability help wanted triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 6h
Merged PRs (30d)
139

Description

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.`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.