[英]How do I install a package using OneGet / install-package from nuget.org
I am attempting to install the Microsoft.Experimental.IO library from here : https://www.nuget.org/packages/Microsoft.Experimental.IO/1.0.0 on Windows 10 using Powershell - Install-Package. 我正在尝试使用Powershell-Install-Package从此处安装Microsoft.Experimental.IO库: https : //www.nuget.org/packages/Microsoft.Experimental.IO/1.0.0在Windows 10上。
I have added the nuget.org repo and when I use the command "find-package -contains experimental " Powershell finds the package, but when i try to install it, I receive the following error. 我已经加入了nuget.org回购,当我使用命令“找到包-包含实验 ” 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
How can I overcome this issue and install the package? 如何解决此问题并安装软件包?
Well I fixed this, by using the following command : install-package -ProviderName nuget -Name Microsoft.Experimental.IO -Destination "C:\\Dev\\Lib\\Microsoft.Experimental.IO"
好吧,我使用以下命令修复了此问题:
install-package -ProviderName nuget -Name Microsoft.Experimental.IO -Destination "C:\\Dev\\Lib\\Microsoft.Experimental.IO"
Which isnt the most intuitive, I've never had to use a destination field when using any other package manager in the past. 哪一种不是最直观的,所以在过去使用任何其他程序包管理器时,我从不需要使用目标字段。 I thought the whole point of a package manager was to standardise on paths and locations etc...
我以为包管理器的全部目的是标准化路径和位置等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.