本文介绍了install-package:检测到程序包'Microsoft.Data.Sqlite'的依赖关系循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用PowerShell的cmdLet install-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?

推荐答案

首先,我在提升的PowerShell提示符中安装运行以下命令的最新Nuget提供程序:

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

Install-PackageProvider Nuget –force –verbose

我解决了另一个软件包的问题,​​在其中我使用-SkipDependencies附加参数遇到了相同的问题:

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

然后install-package对该软件包再次起作用,我显然不明白为什么它突然停止工作,但是-SkipDependencies对我来说是依赖性循环的答案.

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.

这篇关于install-package:检测到程序包'Microsoft.Data.Sqlite'的依赖关系循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 05:38