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

flatten for content files not working #10172

Open
Tracked by #6285
MattiasEppler opened this issue Oct 22, 2020 · 4 comments
Open
Tracked by #6285

flatten for content files not working #10172

MattiasEppler opened this issue Oct 22, 2020 · 4 comments
Labels
Area:ContentFiles PackageReference contentFiles folder Functionality:Pack Priority:2 Issues for the current backlog. Triage:Investigate Type:Bug

Comments

@MattiasEppler
Copy link

Referring to the closed issue

#6213

  <ItemGroup>
    <Content Include="native\*">
      <PackageCopyToOutput>true</PackageCopyToOutput>
      <PackageFlatten>true</PackageFlatten>
    </Content>
  </ItemGroup>

PackageFlatten works only if the consuming project is a .net Framework Project. If you use the new core format csproject Fille (sdk) the files are not flatten in the output directory.

@donnie-msft donnie-msft added Functionality:Pack Product:MSBuildSDKResolver The NuGet powered SDK resolver. Owned by MSBuild team Triage:NeedsMoreInfo Triage:NeedsRepro Triage:NeedsTriageDiscussion Type:Bug Type:Docs WaitingForCustomer Applied when a NuGet triage person needs more info from the OP labels Oct 22, 2020
@donnie-msft
Copy link
Contributor

Thanks for reporting. Please fill out the Issue template here: https://github.com/NuGet/Home/issues/new
This helps in understanding your product versions and scenario.

Documentation still suggests it should be working: https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets#including-content-in-a-package
/cc @zkat

@MattiasEppler
Copy link
Author

Details about Problem

NuGet product used: Visual Studio UI

NuGet version 5.7.0.6726

VS version: 2019

OS version: Windows 10 Pro 1903 / 18362.30

Visual Studio Repros added

NugetPackeSample.zip
Consuming.zip

NugetPackageSample -> VS Solution to create a Nuget Package with content files
Consuming -> VS Solution with two Console Projects (.Net Core and .Net Framwork Format) with reference to the nugetpackage

Detailed repro steps so we can see the same problem

  1. The content files in the nuget package are in the subfolders content and contentfiles.
  2. The content files in the consuming project should be copied flatten to the outputdirectory after build
  3. In the project with the .net framework format the files are copied flatten to the output directory
  4. In the project with the .net core format the files are also copied to the output directory. But not flatten.

@donnie-msft donnie-msft added Area:ContentFiles PackageReference contentFiles folder and removed Triage:NeedsMoreInfo WaitingForCustomer Applied when a NuGet triage person needs more info from the OP labels Oct 23, 2020
@MattiasEppler
Copy link
Author

MattiasEppler commented Oct 26, 2020

Triage:NeedsRepro can be removed. Repro has already been added.

@zkat zkat added Priority:2 Issues for the current backlog. and removed Triage:NeedsRepro Triage:NeedsTriageDiscussion labels Nov 5, 2020
@zkat zkat added this to the Sprint 179 - 2020.11.09 milestone Nov 5, 2020
@zkat zkat self-assigned this Nov 5, 2020
@zkat zkat removed this from the Sprint 179 - 2020.11.09 milestone Nov 9, 2020
@quintonn
Copy link

I am having this same problem.
Is this a bug only with .net core projects because I've read it works with .net Framework projects and in fact I am able to achieve the desired outcome with some of my .net framework projects, but not using .net core (5)?

@jeffkl jeffkl removed the Product:MSBuildSDKResolver The NuGet powered SDK resolver. Owned by MSBuild team label May 2, 2022
@nkolev92 nkolev92 removed the Type:Docs label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:ContentFiles PackageReference contentFiles folder Functionality:Pack Priority:2 Issues for the current backlog. Triage:Investigate Type:Bug
Projects
None yet
Development

No branches or pull requests

7 participants