fsprojects / Paket

A dependency manager for .NET with support for NuGet packages and Git repositories.
https://fsprojects.github.io/Paket/
MIT License
2.02k stars 525 forks source link

Paket restore fails when one of the dependencies declares compatibility with netcoreapp3.0 #3674

Closed tomekpr closed 5 years ago

tomekpr commented 5 years ago

Description

Hi, after the .net core 3.0 has been announced we started to get a lot of paket errors. i.e. when I try to build a project, paket runs and gives me the following:

Paket version 5.156.6 2> Please use the new syntax: '--references-files' has been replaced by '--references-file'. 2> Performance: 2> - Runtime: 643 milliseconds 2> Paket failed with 2> -> Error during parsing of 'C:\Git\Projects\ProjectName\paket.lock'. 2> -> invalid parameter 'netcoreapp3.0' after >= or < in '>= netcoreapp3.0)) (&& (== net471) (>= netstandard2.1)) (== netcoreapp2.1) (== netstandard2.0)'

warning MSB3073: The command ""paket.exe" restore --references-files "C:\Git\Projects\ProjectName\paket.references"" exited with code 1.

I tried to restrict framework in paket.dependencies but no luck either:

framework: net471, netstandard20, netcoreapp21 content: none

Repro steps

The solution is too big to provide here entire paket.lock and dependencies file but I noticed that paket.lock has the following dependency:

System.Security.Cryptography.Cng (4.6) - restriction: || (&& (== net471) (< net20)) (&& (== net471) (>= netcoreapp2.0)) (&& (== net471) (>= netcoreapp2.1)) (&& (== net471) (>= netcoreapp3.0)) (&& (== net471) (>= netstandard2.1)) (== netcoreapp2.1) (== netstandard2.0)

I don't reference 'System.Security.Cryptography.Cng' directly and it must be a transitive dependency.

Expected behavior

I would expect paket to work with netcoreapp3.0

Actual behavior

Paket fails during the restore process

Known workarounds

None at the moment and I'm reluctant to go and pin down every dependency that potentially is compatible with .netcoreapp3.0

Can you guys help?

baronfel commented 5 years ago

Your paket version is very old, you should upgrade to a more recent version to get support for .Net core 3

tomekpr commented 5 years ago

I'm confused. Paket --version gives me 5.219.8 which according to https://github.com/fsprojects/Paket/releases/ is the most recent version.

Am I looking into the wrong place?

baronfel commented 5 years ago

Your report says paket 5.156.6, so it seems like you have multiple versions that are conflicting?

tomekpr commented 5 years ago

Ahh! Good catch. I'm blind today. Will investigate and report back!

tomekpr commented 5 years ago

Ok you won that round @baronfel I had paket installed via choco (old version) and also per project I have .paket folder with paket.exe and bootstrapper. I upgraded choco and that resolved this problem. Thanks again!