Installing System.Net.Http using Install-Package fails with "Dependency loop detected for package"
See original GitHub issueI 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:
Install-Package System.Diagnostics.DiagnosticSource -RequiredVersion 4.5.1 -Provider nuget
Install-Package System.Net.Http -Provider nuget
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.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:8
Top Results From Across the Web
Dependency loop detected for package 'Microsoft.Data. ...
First I Install the latest Nuget provider running following command in an elevated PowerShell prompt: Install-PackageProvider Nuget –force – ...
Read more >Install-Package : Dependency loop detected for ...
Hi, I'm having a rough time trying to install SQL SMO to a server. This is my first time trying Nuget. Previously I...
Read more >NuGet Package Management with PowerShell
I can check if I have NuGet as a Package source using Get-PackageSource ... Install-Package : Dependency loop detected for package 'Azure.
Read more >Install-Package (NuGet) giving a "Deadlock detected" error
Yesterday I created a new virtual machine using… ... Install-Package : Dependency loop detected for package 'SSH.NET'.
Read more >Dependency loop detected for package 'Microsoft.Data.Sqlite'
I am trying to install Microsoft.Data.Sqlite with PowerShell's cmdLet install-package : $pkg = find-package -name Microsoft.Data.Sqlite install-package ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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
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: