Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty Items created when metadata spans multiple lines #224

Closed
rainersigwald opened this issue Nov 29, 2018 · 4 comments
Closed

Empty Items created when metadata spans multiple lines #224

rainersigwald opened this issue Nov 29, 2018 · 4 comments

Comments

@rainersigwald
Copy link
Contributor

From @jachin84 on November 29, 2018 1:20

I'm attempting to create an ItemGroup with some additional metadata and when the metadata spans multiple lines I get empty items created.

Steps to reproduce

Project file

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="BuildAll" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  
  <PropertyGroup>
    <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
  </PropertyGroup>

  <!-- This Item Group defines all the Web Projects that need to be built and deployed -->
  <ItemGroup>
    <ProjectsFiles Include="Project1" />
    <ProjectsFiles Include="Project2" />
    <ProjectsFiles Include="Project3" />
  </ItemGroup>

  <Target Name="BuildAll" >
    <Message Text="Building Projects" Importance="high"/>

    <!-- Work out the correct project properties -->
    <ItemGroup>
      <_ProjectsFiles Include="@(ProjectsFiles)">
        <AdditionalProperties>
        AutoParameterizationWebConfigConnectionStrings=false;
        _PackageTempDir=Out\Dir;
        </AdditionalProperties>
      </_ProjectsFiles>
    </ItemGroup>

    <MSBuild Projects="$(MSBuildThisFileFullPath)"
             BuildInParallel="true"
             ContinueOnError="false"
             Targets="OutputMessage"
             Properties="ProjectName=%(ProjectsFiles.Identity)" />

  </Target>

  <Target Name="OutputMessage">
    <Message Text="Building Project $(ProjectName)" Importance="high"/>
  </Target>
</Project>

Expected behavior

image

Actual behavior

image

Environment data

Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

15.9.20.62856

OS info:
Windows 10 1809

Copied from original issue: dotnet/msbuild#3966

@rainersigwald
Copy link
Contributor Author

From @dasMulli on November 29, 2018 5:57

I believe this is a bug in the log viewer rather than msbuild. cc @KirillOsenkov

    <Message Importance="high" Text="@(_ProjectsFiles->'%(Identity): %(AdditionalMetadata)')" />

or similar are fine.

@rainersigwald
Copy link
Contributor Author

From @jachin84 on November 29, 2018 6:33

I think you might be right.

@KirillOsenkov
Copy link
Owner

I've made a partial fix to at least not display the empty items:

image

@KirillOsenkov
Copy link
Owner

Fixed by dotnet/msbuild#6155

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants