KirillOsenkov / MSBuildStructuredLog

A logger for MSBuild that records a structured representation of executed targets, tasks, property and item values.
MIT License
1.46k stars 198 forks source link

Items that include '=' are stored as properties, incorrectly rendering blue in the viewer #291

Open dagood opened 4 years ago

dagood commented 4 years ago

With this example project:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Target Name="Build">
    <ItemGroup>
      <Thing Include="a;b=c;d = f;foo" />
    </ItemGroup>
  </Target>
</Project>

msbuild /bl and dotnet build /bl give MSBuild binlogs including the following content when saved as xml:

      <AddItem Name="Thing">
        <Item Text="a" />
        <Property Name="b">c</Property>
        <Property Name="d "> f</Property>
        <Item Text="foo" />
      </AddItem>

These show up blue in the viewer and include extra space, which is especially confusing when the items are simple filenames containing =:

image

#> msbuild /version
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

15.9.21.664

#> dotnet --info
...
.NET Core SDKs installed:
...
  3.1.200-preview-014850 [C:\Program Files\dotnet\sdk]
...
KirillOsenkov commented 4 years ago

Yes, this is known unfortunately. I need to think if I can find a workaround. We're just parsing text that MSBuild gives us. We don't have the structure here.

KirillOsenkov commented 3 years ago

With TaskParameterEventArgs this may be fixed actually. Need to verify.