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

Restore FAILS with <RuntimeIdentifiers> set and <PackageReference> to BOTH NS 1.x + 2.0 #6457

Closed
livarcocc opened this issue Jan 19, 2018 · 1 comment
Labels
Functionality:Restore Resolution:External This issue appears to be External to nuget
Milestone

Comments

@livarcocc
Copy link

From @ogreenz on December 4, 2017 14:4

Repro repo:
https://github.com/ogreenz/rid-netstandard2-repro

dotnet --info:

dotnet --info
.NET Command Line Tools (2.0.3)

Product Information:
 Version:            2.0.3
 Commit SHA-1 hash:  12f0c7efcc

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.16299
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.0.3\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.3
  Build    : a9190d4a75f4a982ae4b4fa8d1a24526566c69df

Project references both NodaTime (NS 1.x) and Dapper (NS 2.0).

When built WITHOUT <RuntimeIdentifiers> in the .csproj dotnet restore runs to completion and restore is successfull.

When <RuntimeIdentifiers> is set to any valid value AND both packages are referenced/used restore fails with these cryptic messages:

$ dotnet restore
  Restoring packages for C:\projects\repro-netstandard\repro-netstandard.csproj...
C:\projects\repro-netstandard\repro-netstandard.csproj : error NU1605: Detected package downgrade: System.IO.FileSystem.Primitives from 4.3.0 to 4.0.1. Reference the package directly from the project to select a different version.
C:\projects\repro-netstandard\repro-netstandard.csproj : error NU1605:  repro-netstandard -> NodaTime 2.2.3 -> System.Runtime.Serialization.Xml 4.1.1 -> System.Xml.ReaderWriter 4.0.11 -> System.IO.FileSystem 4.0.1 -> runtime.win.System.IO.FileSystem 4.3.0 -> System.IO.FileSystem.Primitives (>= 4.3.0)
C:\projects\repro-netstandard\repro-netstandard.csproj : error NU1605:  repro-netstandard -> NodaTime 2.2.3 -> System.Runtime.Serialization.Xml 4.1.1 -> System.Xml.ReaderWriter 4.0.11 -> System.IO.FileSystem.Primitives (>= 4.0.1)
C:\projects\repro-netstandard\repro-netstandard.csproj : error NU1605: Detected package downgrade: System.Resources.ResourceManager from 4.3.0 to 4.0.1. Reference the package directly from the project to select a different version.
C:\projects\repro-netstandard\repro-netstandard.csproj : error NU1605:  repro-netstandard -> NodaTime 2.2.3 -> System.Runtime.Serialization.Xml 4.1.1 -> System.Xml.ReaderWriter 4.0.11 -> System.IO.FileSystem 4.0.1 -> runtime.win.System.IO.FileSystem 4.3.0 -> System.Resources.ResourceManager (>= 4.3.0)
C:\projects\repro-netstandard\repro-netstandard.csproj : error NU1605:  repro-netstandard -> NodaTime 2.2.3 -> System.Runtime.Serialization.Xml 4.1.1 -> System.Xml.ReaderWriter 4.0.11 -> System.Resources.ResourceManager (>= 4.0.1)
C:\projects\repro-netstandard\repro-netstandard.csproj : error NU1605: Detected package downgrade: System.Runtime.Handles from 4.3.0 to 4.0.1. Reference the package directly from the project to select a different version.
C:\projects\repro-netstandard\repro-netstandard.csproj : error NU1605:  repro-netstandard -> NodaTime 2.2.3 -> System.Runtime.Serialization.Xml 4.1.1 -> System.Xml.ReaderWriter 4.0.11 -> System.IO.FileSystem 4.0.1 -> runtime.win.System.IO.FileSystem 4.3.0 -> System.Runtime.Handles (>= 4.3.0)
C:\projects\repro-netstandard\repro-netstandard.csproj : error NU1605:  repro-netstandard -> NodaTime 2.2.3 -> System.Runtime.Serialization.Xml 4.1.1 -> System.Xml.ReaderWriter 4.0.11 -> System.IO.FileSystem 4.0.1 -> System.Runtime.Handles (>= 4.0.1)
C:\projects\repro-netstandard\repro-netstandard.csproj : error NU1605: Detected package downgrade: System.Runtime.InteropServices from 4.3.0 to 4.1.0. Reference the package directly from the project to select a different version.
C:\projects\repro-netstandard\repro-netstandard.csproj : error NU1605:  repro-netstandard -> NodaTime 2.2.3 -> System.Runtime.Serialization.Xml 4.1.1 -> System.Xml.ReaderWriter 4.0.11 -> System.IO.FileSystem 4.0.1 -> runtime.win.System.IO.FileSystem 4.3.0 -> System.Runtime.InteropServices (>= 4.3.0)
C:\projects\repro-netstandard\repro-netstandard.csproj : error NU1605:  repro-netstandard -> NodaTime 2.2.3 -> System.Runtime.Serialization.Xml 4.1.1 -> System.Xml.ReaderWriter 4.0.11 -> System.Runtime.InteropServices (>= 4.1.0)
C:\projects\repro-netstandard\repro-netstandard.csproj : error NU1605: Detected package downgrade: System.Text.Encoding.Extensions from 4.3.0 to 4.0.11. Reference the package directly from the project to select a different version.
C:\projects\repro-netstandard\repro-netstandard.csproj : error NU1605:  repro-netstandard -> NodaTime 2.2.3 -> System.Runtime.Serialization.Xml 4.1.1 -> System.Xml.ReaderWriter 4.0.11 -> System.IO.FileSystem 4.0.1 -> runtime.win.System.IO.FileSystem 4.3.0 -> System.Text.Encoding.Extensions (>= 4.3.0)
C:\projects\repro-netstandard\repro-netstandard.csproj : error NU1605:  repro-netstandard -> NodaTime 2.2.3 -> System.Runtime.Serialization.Xml 4.1.1 -> System.Xml.ReaderWriter 4.0.11 -> System.Text.Encoding.Extensions (>= 4.0.11)
  Generating MSBuild file C:\projects\repro-netstandard\obj\repro-netstandard.csproj.nuget.g.props.
  Restore failed in 378 ms for C:\projects\repro-netstandard\repro-netstandard.csproj.

Note that if Dapper / NodaTime are used exclusively dotnet restore while using <RuntimeIdentifiers> runs successfully again....

Copied from original issue: dotnet/sdk#1792

@emgarten
Copy link
Member

It looks like NuGet is correctly identifying the downgrades due to how these packages are authored, and the SDK is setting NU1605 to an error.

Getting different packages is expected when using a RID. If the packages brought in by the RID cause problems then it is also a package authoring issue.

@emgarten emgarten added this to the 4.7 milestone Jan 20, 2018
@emgarten emgarten added Functionality:Restore Resolution:External This issue appears to be External to nuget labels Jan 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Restore Resolution:External This issue appears to be External to nuget
Projects
None yet
Development

No branches or pull requests

2 participants