fsprojects / fsprojects/Paket

`dotnet restore` doesn't restore everything needed

Open
#2,892 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug resolution sdk: dotnet/sdk
Dominant language
F#
Stars
2.1k
Forks
528
Avg merge
1d 12m
Merged PRs (30d)
54

Description

Description

I want to restore a project from scratch e.g. a netcore1.1 project with the .net sdk2.0.2. It seems like paket resolves all dependencies correctly, but dnc demands some more (maybe for compiling or so). I call these hidden or injected dependencies

Repro steps
  1. Clean your ~/.nuget folder (windows)
  2. Use the repo: https://github.com/Stift/PaketPublishBug171107
  3. Go to folder src\withPaket and run dotnet restore
Expected behavior

Restore should be successful. - no error messages

Actual behavior

Some error messages are shown:

Paket version 5.122.0
  Downloading Microsoft.NETCore.Targets 2.0
  Downloading Microsoft.CSharp 4.4
  Downloading Microsoft.Win32.Primitives 4.3
  Downloading runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2
  Downloading Newtonsoft.Json 10.0.3
  Downloading NETStandard.Library 2.0.1
  Downloading Microsoft.NETCore.Platforms 2.0
  Downloading runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2
  Downloading runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2
  Downloading runtime.native.System 4.3
  Downloading runtime.native.System.IO.Compression 4.3.1
  Downloading runtime.native.System.Net.Http 4.3
  Downloading runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2
  Downloading runtime.native.System.Security.Cryptography.OpenSsl 4.3.2
  Downloading runtime.native.System.Security.Cryptography.Apple 4.3.1
  Downloading runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2
  Downloading runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple 4.3.1
  Downloading runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2
  Downloading runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2
  Downloading runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2
  Downloading runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2
  Downloading runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2
  Downloading System.Buffers 4.4
  Downloading System.Collections.Concurrent 4.3
  Downloading System.Collections 4.3
  Downloading System.AppContext 4.3
  Downloading System.Collections.NonGeneric 4.3
  Downloading System.Collections.Specialized 4.3
  Downloading System.ComponentModel 4.3
  Downloading System.ComponentModel.TypeConverter 4.3
  Downloading System.Console 4.3
  Downloading System.Diagnostics.Debug 4.3
  Downloading System.ComponentModel.Primitives 4.3
  Downloading System.Diagnostics.DiagnosticSource 4.4.1
  Downloading System.Diagnostics.Tools 4.3
  Downloading System.Diagnostics.Tracing 4.3
  Downloading System.Dynamic.Runtime 4.3
  Downloading System.Globalization 4.3
  Downloading System.Globalization.Calendars 4.3
  Downloading System.Globalization.Extensions 4.3
  Downloading System.IO 4.3
  Downloading System.IO.Compression 4.3
  Downloading System.IO.Compression.ZipFile 4.3
  Downloading System.IO.FileSystem 4.3
  Downloading System.IO.FileSystem.Primitives 4.3
  Downloading System.Linq 4.3
  Downloading System.Linq.Expressions 4.3
  Downloading System.Net.Http 4.3.3
  Downloading System.Net.Primitives 4.3
  Downloading System.Net.Sockets 4.3
  Downloading System.ObjectModel 4.3
  Downloading System.Reflection 4.3
  Downloading System.Reflection.Emit 4.3
  Downloading System.Reflection.Emit.ILGeneration 4.3
  Downloading System.Reflection.Emit.Lightweight 4.3
  Downloading System.Reflection.Extensions 4.3
  Downloading System.Reflection.Primitives 4.3
  Downloading System.Reflection.TypeExtensions 4.4
  Downloading System.Resources.ResourceManager 4.3
  Downloading System.Runtime 4.3
  Downloading System.Runtime.Extensions 4.3
  Downloading System.Runtime.Handles 4.3
  Downloading System.Runtime.InteropServices 4.3
  Downloading System.Runtime.InteropServices.RuntimeInformation 4.3
  Downloading System.Runtime.Numerics 4.3
  Downloading System.Runtime.Serialization.Formatters 4.3
  Downloading System.Runtime.Serialization.Primitives 4.3
  Downloading System.Security.Cryptography.Algorithms 4.3
  Downloading System.Security.Cryptography.Cng 4.4
  Downloading System.Security.Cryptography.Csp 4.3
  Downloading System.Security.Cryptography.Encoding 4.3
  Downloading System.Security.Cryptography.OpenSsl 4.4
  Downloading System.Security.Cryptography.Primitives 4.3
  Downloading System.Security.Cryptography.X509Certificates 4.3.1
  Downloading System.Threading 4.3
  Downloading System.Text.Encoding.Extensions 4.3
  Downloading System.Text.RegularExpressions 4.3
  Downloading System.Text.Encoding 4.3
  Downloading System.Threading.Tasks 4.3
  Downloading System.Threading.Tasks.Extensions 4.4
  Downloading System.Xml.ReaderWriter 4.3
  Downloading System.Threading.Timer 4.3
  Downloading System.Xml.XDocument 4.3
  Downloading System.Xml.XmlDocument 4.3
  Performance:
   - Disk IO: 39 seconds
   - Average Download Time: 1 second
   - Number of downloads: 84
   - Average Request Time: 632 milliseconds
   - Number of Requests: 71
   - Runtime: 8 seconds
  Restoring packages for F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj...
  Installing System.Xml.XPath 4.3.0.
  Installing System.Security.Principal 4.3.0.
  Installing System.Security.Claims 4.3.0.
  Installing Microsoft.NETCore.DotNetAppHost 2.0.0.
  Installing System.Xml.XPath.XDocument 4.3.0.
  Installing System.ValueTuple 4.3.0.
  Installing System.Text.Encoding.CodePages 4.3.0.
  Installing System.Diagnostics.StackTrace 4.3.0.
  Installing System.Diagnostics.FileVersionInfo 4.3.0.
  Installing Microsoft.CodeAnalysis.Analyzers 1.1.0.
  Installing System.Security.Principal.Windows 4.3.0.
  Installing Microsoft.NETCore.DotNetHostResolver 2.0.0.
  Installing Microsoft.CodeAnalysis.Common 2.3.1.
  Installing Microsoft.NETCore.App 2.0.0.
  Installing System.Threading.ThreadPool 4.3.0.
  Installing System.Threading.Thread 4.3.0.
  Installing System.Threading.Tasks.Parallel 4.3.0.
  Installing Libuv 1.10.0.
  Installing Microsoft.CodeAnalysis.CSharp 2.3.1.
  Installing Microsoft.NETCore.DotNetHostPolicy 2.0.0.
  Installing NETStandard.Library 1.6.1.
  Installing System.Collections.Immutable 1.3.0.
  Installing System.ComponentModel.Annotations 4.4.0.
  Installing System.Linq.Parallel 4.3.0.
  Installing System.Net.NameResolution 4.3.0.
  Installing System.Reflection.Metadata 1.4.1.
  Installing System.Numerics.Vectors 4.4.0.
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1101: Unable to find package Microsoft.CodeAnalysis.VisualBasic. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\NuGetFallbackFolder
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1101: Unable to find package Microsoft.DiaSymReader.Native. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\NuGetFallbackFolder

F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1101: Unable to find package Microsoft.NETCore.Runtime.CoreCLR. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\NuGetFallbackFolder
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1101: Unable to find package Microsoft.VisualBasic. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\NuGetFallbackFolder
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1102: Unable to find package System.Diagnostics.Process with version (>= 4.3.0)\r
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1102:   - Found 1 version(s) in C:\Program Files\dotnet\sdk\NuGetFallbackFolder [ Nearest version: 4.1.0 ]
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1101: Unable to find package System.IO.FileSystem.Watcher. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\NuGetFallbackFolder F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1101: Unable to find package System.IO.MemoryMappedFiles. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\NuGetFallbackFolder
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1101: Unable to find package System.IO.UnmanagedMemoryStream. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\NuGetFallbackFolder
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1102: Unable to find package System.Linq.Queryable with version (>= 4.3.0)\r
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1102:   - Found 1 version(s) in C:\Program Files\dotnet\sdk\NuGetFallbackFolder [ Nearest version: 4.0.1 ]
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1101: Unable to find package System.Net.Requests. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\NuGetFallbackFolder
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1102: Unable to find package System.Net.Security with version (>= 4.3.1)\r
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1102:   - Found 1 version(s) in C:\Program Files\dotnet\sdk\NuGetFallbackFolder [ Nearest version: 4.3.0 ]
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1101: Unable to find package System.Net.WebHeaderCollection. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\NuGetFallbackFolder
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1101: Unable to find package System.Reflection.DispatchProxy. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\NuGetFallbackFolder
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1102: Unable to find package System.Resources.Reader with version (>= 4.3.0)\r
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1102:   - Found 1 version(s) in C:\Program Files\dotnet\sdk\NuGetFallbackFolder [ Nearest version: 4.0.0 ]
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1102: Unable to find package System.Runtime.Loader with version (>= 4.3.0)\r
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1102:   - Found 1 version(s) in C:\Program Files\dotnet\sdk\NuGetFallbackFolder [ Nearest version: 4.0.0 ]
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1102: Unable to find package System.Threading.Tasks.Dataflow with version (>= 4.7.0)\r
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1102:   - Found 1 version(s) in C:\Program Files\dotnet\sdk\NuGetFallbackFolder [ Nearest version: 4.6.0 ]
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1101: Unable to find package runtime.win-x64.Microsoft.NETCore.App. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\NuGetFallbackFolder
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1101: Unable to find package runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\NuGetFallbackFolder
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1101: Unable to find package runtime.win-x64.Microsoft.NETCore.DotNetHostResolver. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\NuGetFallbackFolder
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1101: Unable to find package runtime.win-x64.Microsoft.NETCore.DotNetAppHost. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\NuGetFallbackFolder
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1605: Detected package downgrade: System.Collections.Immutable from 1.3.1 to 1.3.0. Reference the package directly from the project to select a different version. \r
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1605:  SelfContainedTest -> Microsoft.NETCore.App 2.0.0 -> Microsoft.CodeAnalysis.CSharp 2.3.1 -> Microsoft.CodeAnalysis.Common 2.3.1 -> System.Collections.Immutable (>= 1.3.1) \r
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1605:  SelfContainedTest -> Microsoft.NETCore.App 2.0.0 -> System.Collections.Immutable (>= 1.3.0)
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1605: Detected package downgrade: System.Reflection.Metadata from 1.4.2 to 1.4.1. Reference the package directly from the project to select a different version. \r
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1605:  SelfContainedTest -> Microsoft.NETCore.App 2.0.0 -> Microsoft.CodeAnalysis.CSharp 2.3.1 -> Microsoft.CodeAnalysis.Common 2.3.1 -> System.Reflection.Metadata (>= 1.4.2) \r
F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj : error NU1605:  SelfContainedTest -> Microsoft.NETCore.App 2.0.0 -> System.Reflection.Metadata (>= 1.4.1)
  Generating MSBuild file F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\obj\SelfContainedTest.csproj.nuget.g.props.
  Generating MSBuild file F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\obj\SelfContainedTest.csproj.nuget.g.targets.
  Restore failed in 1,49 sec for F:\Data\Dropbox\pakettest\dotnetcore\src\withPaket\SelfContainedTest.csproj.

Known workarounds

go after the last step to the folder src\noPaket and run dotnet restore to see what is missing when downloaded.

It seems when I open VisualStudio or use nuget instead of paket everything works fine. Maybe dnc injects some dependencies outside of the dependency tree which are not downloaded when paket intercepts the dnc process.
As this happens on build agents VisualStudio is not an option. 😢

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by clearing the Windows ~/.nuget folder and running dotnet restore in src\withPaket from the linked PaketPublishBug171107 reproduction repository. Inspect the reported SelfContainedTest.csproj restore failures and compare Paket's resolved packages with the missing dependencies; done means restore completes without NU1101 or NU1102 errors.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.