Open hickford opened 1 week ago
The bug does not occur with Item elements. Of course, you have to escape the MSBuild special characters:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="Build">
<ItemGroup>
<Keys Include="abcdefg;a%24%28d%29fg;a%24%28d.f%29" />
</ItemGroup>
<Message Text="Keys (expanded)=@(Keys)" />
<Message Text="Keys (individual)=%(Keys.Identity)" />
</Target>
</Project>
Here's the offending code: XmlPeek neglects to escape the item:
Issue Description
It looks like XmlPeek Result output item metadata is not properly escaped.
Steps to Reproduce
Create an XML document
doc.xml
with text content that happens to use MSBuild special characters:Run
msbuild project.proj
project.proj that uses XmlPeek to query and print the three keys:Expected Behavior
Prints verbatim text content from XML file.
Actual Behavior
Prints verbatim text content for property and expanded item, but tries to interpret item metadata as MSBuild property. This is inconsistent and confusing.
and gives error:
Analysis
No response
Versions & Configurations