dotnet / NuGet.BuildTasks

The build tasks used to pick up package content from project.lock.json.
MIT License
45 stars 61 forks source link

ResolveNuGetPackageAssets.ReferencedPackages returns the wrong result when dependencies are listed under framework #76

Open nkolev92 opened 4 years ago

nkolev92 commented 4 years ago

Sample project:

{
  "dependencies": {
    "System.Runtime": "4.0.0",
    "System.Dynamic.Runtime": "4.0.0",
    "System.Linq.Expressions": "4.0.0"
  },
  "frameworks": {
    "dotnet5.1": {
      "dependencies": {
        "System.IO": "4.0.0"
      }
    }
  }
}

When building this I would expect the build task to return System.IO in the list of ReferencedPackages. It does not.

Potentially hacky fix: https://github.com/dotnet/buildtools/pull/368

Moved from: https://github.com/NuGet/Home/issues/1843

cc @ericstj @jasonmalinowski