Skip to content

Items returned by tasks not considered for EmbedInBinlog #7665

@KirillOsenkov

Description

@KirillOsenkov

I'd expect this to embed C:\temp\1.txt into the binlog, but it doesn't:

<Project>

  <Target Name="Build">
    <MSBuild Projects="$(MSBuildThisFileFullPath)" Targets="GetItems">
      <Output TaskParameter="TargetOutputs" ItemName="EmbedInBinlog" />
    </MSBuild>
  </Target>

  <Target Name="GetItems" Returns="@(ResultItem)">
    <ItemGroup>
      <ResultItem Include="C:\temp\1.txt" />
    </ItemGroup>
  </Target>
  
</Project>

As a workaround to fix this, also need to add an explicit ItemGroup:

<Project>

  <Target Name="Build">
    <MSBuild Projects="$(MSBuildThisFileFullPath)" Targets="GetItems">
      <Output TaskParameter="TargetOutputs" ItemName="EmbedInBinlog" />
    </MSBuild>
    <ItemGroup>
      <EmbedInBinlog Include="@(EmbedInBinlog)" />
    </ItemGroup>
  </Target>

  <Target Name="GetItems" Returns="@(ResultItem)">
    <ItemGroup>
      <ResultItem Include="C:\temp\1.txt" />
    </ItemGroup>
  </Target>
  
</Project>

I think this line:

if (e.Kind == TaskParameterMessageKind.AddItem)

should also allow for TaskParameterMessageKind.TaskOutput

Metadata

Metadata

Assignees

Labels

Area: DebuggabilityIssues impacting the diagnosability of builds, including logging and clearer error messages.Area: LoggingGood First IssueSelf-contained issues good for first-time contributors.help wantedIssues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim.triaged

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions