NuGet/Home

ContentFilesExample package doesn't work when the PCL frameworks are selected as assets

coffee-lover16 opened this issue · 7 comments

Details about Problem

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe):
VS Package Manager Console

NuGet version (x.x.x.xxx):
4.9.4.5839

VS version (if appropriate):
15.9.9
OS version (i.e. win10 v1607 (14393.321)):
Win 10

Detailed repro steps

  1. Enable PackageReference for Nuget in VS

  2. Create new class library based on .Net Framework 4.6.2(same for 4.5)

  3. Go to the 'Package Manager Console' and enter Install-Package contentfilesexample. Package url: https://www.nuget.org/packages/ContentFilesExample

Result:

There aren't any content files in the project

Other suggested things

That works fine for .Net Core projects

Is it possible to get that working for .Net Framework projects that use PackageReference?

@Eugenio161288
I was not able to reproduce the issue.

The content files that are copy to output are copied to the output directory at build time.

I believe what you are seeing is dotnet/project-system#3431

Just tried that on Console application. .Net Framework 4.6.2. There is the following error during project building:

image

Steps:

  1. Create new solution
  2. Choose Console Application with .Net Framework 4.6.2
  3. Go to the Package Manager Console
  4. Type Install-Package contentfilesexample
  5. Build project

NuGet is the one generating the folders and the assets file.
It's the build tasks that handle the copying and wiring up into the build.

The error message suggests that the path is getting decoded.

I'll investigate and rout to them as necessary.

@Eugenio161288

This is a problem in the build targets.
New style projects have the same issue:

dotnet/sdk#3069

//cc @tmeschter for the old csproj targets.

The build targets should not decode the path, but rather treat it as a string.

@Eugenio161288

I will fix the contentfilesexample package to not include PCL framework as they are no longer the recommended way.

What you are referring to seems to be a duplicate of another report NuGet/Samples#21

Closing this as there's nothing actionable remaining from NuGet.