13

I am trying to install Microsoft.Data.Sqlite with PowerShell's cmdLet install-package:

$pkg = find-package -name Microsoft.Data.Sqlite
install-package -force -scope currentUser -verbose $pkg

The second command takes a long time and then responds with

install-package : Dependency loop detected for package 'Microsoft.Data.Sqlite'.
At line:1 char:1
+ install-package -force -scope currentUser -verbose $pkg
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : Deadlock detected: (Microsoft.Data.Sqlite:String) [Install-Package], Exception
+ FullyQualifiedErrorId : DependencyLoopDetected,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

Why is that and what do I have to do in order to install this package?

3
  • 3
    i recall seeing this for other packages - one of the posts linked to this >>> Installing System.Net.Http using Install-Package fails with "Dependency loop detected for package" · Issue #475 · OneGet/oneget — github.com/OneGet/oneget/issues/475 Commented Oct 12, 2019 at 9:54
  • See also: stackoverflow.com/q/58417976/45375 Commented Oct 18, 2019 at 20:06
  • 1
    @René Nyffenegger, -SkipDependencies works for me. Commented Nov 27, 2019 at 18:14

1 Answer 1

13

First I Install the latest Nuget provider running following command in an elevated PowerShell prompt:

Install-PackageProvider Nuget –force –verbose

I resolved the trouble with another package where I met the same trouble using -SkipDependencies additional parameter :

Install-Package libphonenumber-csharp -Destination ".\NugetPackages" -Force -Source 'https://www.nuget.org/api/v2' -ProviderName NuGet -RequiredVersion '8.10.23' -SkipDependencies -ErrorAction SilentlyContinue

Then install-package works again for this package, I clearly don't understand why it suddendly stop working, but -SkipDependencies is for me the answer to dependency loop.

Sign up to request clarification or add additional context in comments.

2 Comments

I'm not sure this will solve the problem. This will only silence the errors. Additionally the user may lose some functionalities by skipping dependencies
@AymenDaoudi for many packages it solves the error for me. For complex dependencies, you have to load each package. But if you prefered staid stuck.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.