Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.1k views
in Technique[技术] by (71.8m points)

powershell - install-package : 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 -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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...