2

我正在尝试从此处安装 Microsoft.Experimental.IO 库:https ://www.nuget.org/packages/Microsoft.Experimental.IO/1.0.0 on Windows 10 using Powershell - Install-Package。

我添加了 nuget.org 存储库,当我使用命令“find-package -contains experimental ”时,Powershell 找到了包,但是当我尝试安装它时,我收到以下错误。

install-package Microsoft.Experimental.IO -verbose
VERBOSE: Skipping package provider provider 'NuGet'-- missing required option 'Destination'
VERBOSE: Skipping package provider provider 'NuGet'-- missing required option 'Destination'
VERBOSE: The -Repository parameter was not specified.  PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2/' and PackageManagementProvider is 'NuGet'.
install-package : No match was found for the specified search criteria and package name 'Microsoft.Experimental.IO'.
At line:1 char:1
+ install-package Microsoft.Experimental.IO -verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

我该如何克服这个问题并安装软件包?

4

1 回答 1

5

好吧,我通过使用以下命令解决了这个问题: install-package -ProviderName nuget -Name Microsoft.Experimental.IO -Destination "C:\Dev\Lib\Microsoft.Experimental.IO"

这不是最直观的,在过去使用任何其他包管理器时,我从来不需要使用目标字段。我认为包管理器的全部意义在于标准化路径和位置等......

于 2016-03-18T10:14:31.673 回答