Home

LINQPad NuGet packages - Circular dependency bug?

edited June 2018
When trying to download certain NuGet packages, it appears LINQPad tries to use version 4 of the System.Reactive package when it should be using version 3.1.

The error reads "Error downloading WebLinq 1.0.0-alpha-20170321T1506(Prerelease) - Circular dependency detected 'System.Reactive 3.1.0 => System.Reactive.PlatformServices 4.0.0-preview.2.build.379 => System.Reactive 3.1.0"

I get a similar error when I try to download System.Reactive 3.1.0 for instance.

I tried clearing my NuGet cache in %LocalAppData%\LINQPad\NuGet.FW46 but unfortunately this didn't work. The only workaround found so far has been to copy someone else's WebLinq or System.Reactive NuGet cache into my machine.

Comments

  • I get the same error when I download WebLinq with NuGet.exe. Could there be something wrong with the package?
  • I've got a very similar situation (tried on multiple PCs).

    It happens with a package from our own & private nuget feed so I cannot share the package.

    The circular dependency chain ends with very System.Reactive 3.1.1 => System.Reactive.PlatformServices 4.0.0 => System.Reactive 3.1.1

    Same package is installing just fine in an empty project in Visual Studio. No errors are shown.

    Any ideas how to overcome this issue?
    (I tried cleaning up linqpad's nuget cache, didn't work.
  • Cleaning the cache from UI seemed to have no effect, the package location seemed to contain same packages as before. So I deleted everything in the default package location of linqpad.
    Now none of the scripts that were using our own packages are working, all failing with same circular reference error involving Reactive package :/

    Please send help!
  • Uninstalled linqpad completely (btw, updates aren't removed) and deleted again anything I found in ProgramData and LocalAppData.

    Installed latest beta, same behavior :(
  • Do you get any error when installing that package from the command-line using nuget.exe?
  • Yes. I'm getting the same error when using nuget.exe install command.

    All other ways that I tried:
    - Package Manager UI
    - Package Manager Console
    - dotnet add package

    All of these do succeed and allow to add the package successfully.
  • LINQPad uses NuGet.exe to install packages, which explains the correlation.

    The problem with System.Reactive 3.1.0 causing circular dependencies is a known issue:
    https://github.com/NuGet/Home/issues/5751

    "System.Reactive packages appear to have reversed dependency order between versions which is especially painful since the 3.x packages do not have an upper bound on the dependency ranges, which means that the circular combination is allowed."

    "When resolving packages NuGet does not attempt to look for other solutions if a circular dependency occurs, this is considered a package authoring error and it is usually better to fail with a helpful message there instead of potentially coming up with a very unexpected set of packages to workaround the problem automatically. Here you don't own these packages, so it isn't very helpful unfortunately."

    More info:
    https://github.com/reactiveui/ReactiveUI/issues/1413

    and on StackOverflow:
    https://stackoverflow.com/questions/48878418/circular-dependency-detected-when-installing-nuget-package-akavache-6-0-0-alpha

    "The resolver for packages.config and PackageReference restore styles work differently. Packages.config does the resolution only at install time and tries to resolve all dependencies! It obeys the "nearest first" rule to a tee, and if it happens that leads to a circular dependency, so be it. PackageReference is smarter in that it will try to resolve some of these conflicts and bump-up or bump down some versions"

    In terms of a resolution with LINQPad, a fix would require that NuGet.exe be updated to relax the rules regarding circular dependencies. Alternatively, if you have control over the package in question, upgrading the dependency to the latest System.Reactive (4.0) would fix the problem.
  • Thanks Joe for your help!

    We're considering at the moment upgrading System.Reactive to latest version across all of our packages. Despite the hassle (number of packages) seems to be the only solution that will work.
Sign In or Register to comment.