Skip to content

Simplify content embedding in the new csproj format. #3192

@sandorfr

Description

@sandorfr

Steps to reproduce

The syntax to just include files files in an output package seems overly complicated for such a simple task.

Actual behavior

Currently we have to remove the files from the <None> and add them to <Content> which is not enough as we also need to add a <CopyToOutputDirectory>. With out the latter, Content just does nothing.

  <ItemGroup>
    <None Remove="MailTemplates\*.hbs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="MailTemplates\*.hbs">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

Expected behavior

We expect something as simple as that (or similar) to just work.

  <ItemGroup>
      <Content Include="MailTemplates\*.hbs" />
  </ItemGroup>

Environment data

msbuild /version output: 15.6.82.30579

OS info: Windows 10

If applicable, version of the tool that invokes MSBuild (Visual Studio, dotnet CLI, etc):
dotnet cli: 2.1.102

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions