dotnet/msbuild

Better error message for malformed item transformations

Open

#333 创建于 2015年11月5日

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

仓库指标

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

描述

A definition of an item ThisItem

<ItemGroup>
    <ThisItem Include="@(AnotherItem->$(APath)\%(Filename)%(Extension))" />
</ItemGroup>

Followed by a usage of ThisItem of the form:

%(ThisItem.FullPath)

Fails with the error: error MSB4023: Cannot evaluate the item metadata "%(FullPath)". The item metadata "%(FullPath)" cannot be applied to the path "@(AnotherItem->c:\projects\msbuild\bin\Debug-NetCore\Windows_NT_Deployment_Test)". Illegal characters in path".

The error is currently caught when the malformed item is used, not when the malformed item is created. Instead, the error should be caught at item definition with a text mentioning the missing single quotes (correct definition is "@(AnotherItem->'$(APath)%(Filename)%(Extension)')")

贡献者指南