KEMBAR78
contentFiles under "any" folder doesn't work with PackageReference-style with classic csproj · Issue #3042 · dotnet/project-system · GitHub
Skip to content

contentFiles under "any" folder doesn't work with PackageReference-style with classic csproj #3042

@jainaashish

Description

@jainaashish

Copied from NuGet/Home#6287

Details about Problem

Using VS UI/nuget.exe pack

NuGet version in VS: 4.5.0

VS version: 15.5.0

OS version: win10 v1709 (16299.98)

Detailed repro steps so we can see the same problem

  1. See the repro below. Basically try using contentFiles to control attributes like copyToOutput and have the target folder use "any" rather than a specific value
  2. Pack the nuspec and install the nupkg into a .NET Framework project using PackageReference style.
  3. Alternatively, use a CPS-style csproj with TargetFramwork=net471 (or similar)

Expected:
All the files listed appear in the output directory after building.

Actual:
Only the file in contentFiles\cs\net45 appears in the output directory after building.

Note that the bug does not repro when using a .NET Core project.
Note also that the bug is only for target locations such as:
contentFiles\cs\any
contentFiles\any\any

Things work correctly for targets such as:
contentFiles\cs\net45

Apologies if this is a dup, but I couldn't find this specific issue in a quick search.

Sample Project

repro.zip

Metadata

Metadata

Assignees

Labels

Feature-NuGetNuGet integration including pushing it properties, project and package references, and Pack support.LegacyIssues against the legacy project system.Triage-InvestigateReviewed and investigation needed by dev team

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions