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

Installing System.Net.Http using Install-Package fails with "Dependency loop detected for package" #475

Open
fqborges opened this issue Oct 4, 2019 · 8 comments

Comments

@fqborges
Copy link

fqborges commented Oct 4, 2019

I am installing packages to a folder using the following pwsh commands:

Register-PackageSource -Location https://www.nuget.org/api/v2 -Name Nuget -ProviderName Nuget -Trusted -force

Install-Package -Name System.Net.Http -ProviderName Nuget -Destination $somedir

It fails with:

Install-Package : Dependency loop detected for package 'System.Net.Http'.
At C:\git\mobiltracker-ps-docker\Publish-PackageDll.ps1:81 char:1
+ Install-Package -Name $Name -ProviderName Nuget -Destination $Source  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : Deadlock detected: (System.Net.Http:String) [Install-Package], Exception
+ FullyQualifiedErrorId : DependencyLoopDetected,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

It looks like the offending package is System.Diagnostics.DiagnosticSource v4.6.0

Workaround:

Installing in the current order works:

  1. Install-Package System.Diagnostics.DiagnosticSource -RequiredVersion 4.5.1 -Provider nuget
  2. Install-Package System.Net.Http -Provider nuget
  3. Install-Package System.Diagnostics.DiagnosticSource -Provider nuget

I opened an issue (https://github.com/dotnet/corefx/issues/41532) on dotnet core repo, but it seems to be related to this client cmdlets.

@nvarscar
Copy link

nvarscar commented Oct 7, 2019

I'm seeing the same behaviour with two unrelated packages on Powershell 6.2.5 running on an Ubuntu machine in Appveyor.
Here's some details I was able to capture:

Exception                     : System.Exception: Dependency loop detected for package 'Npgsql'.
TargetObject                  : Npgsql
FullyQualifiedErrorId         : DependencyLoopDetected,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
InvocationInfo                : System.Management.Automation.InvocationInfo
ErrorCategory_Category        : 4
ErrorCategory_Activity        : Install-Package
ErrorCategory_Reason          : Exception
ErrorCategory_TargetName      : Npgsql
ErrorCategory_Message         : Deadlock detected: (Npgsql:String) [Install-Package], Exception

@dmoore-risklens
Copy link

I was trying to download "System.Data.SqlClient" with command .
"Install-Package System.Data.SqlClient -verbose -providername nuget" I kept running in to this problem so I just did the above work around and it worked for me. I am trying to install "dbup" and this blocked me. Thank you

@MartinHBA
Copy link

it's nice that you have workaround, but can someone fix this pls?

@urbantom
Copy link

Seems, I'm affected by the same issue. My case arose when I was trying to run the command
Install-Package -Name Microsoft.NET.Test.Sdk -MinimumVersion 16.3.0 -Scope CurrentUser

@MartinHBA
Copy link

@urbantom it's PowerShell implementation of Nuget provider, it's just awful. It works only with packages without dependencies (or maybe simple dependencies). You can install package with skip dependencies parameter, but you might lose some functionality which is sad. Nuget+PowerShell is total lame. See my gist example and compare

@urbantom
Copy link

@MartinHBA Thanks for the info. Indeed, sad news.

@GehanPanapitiya
Copy link

Install-Package Microsoft.Web.Administration -Force -Confirm:$False -RequiredVersion 11.0.0 fails for same reason

@MartinHBA
Copy link

@GehanPanapitiya hopefully it will be addressed in new PowerShellGet v3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants