简体   繁体   English

安装Web API客户端库

[英]Install the Web API Client Libraries

在此处输入图片说明 I want to install Install-Package Microsoft.AspNet.WebApi.Client. 我想安装Install-Package Microsoft.AspNet.WebApi.Client。 using From the Tools menu, select Library Package Manager, then select Package Manager Console. 使用从“工具”菜单中,选择“库软件包管理器”,然后选择“软件包管理器控制台”。 In the Package Manager Console window, type the following command. 在“程序包管理器控制台”窗口中,键入以下命令。

Cannot install the Install the Web API Client Libraries. 无法安装“安装Web API客户端库”。 Getting this message. 收到此消息。 Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. Windows PowerShell成功更新了您的执行策略,但是该设置被在更特定范围内定义的策略覆盖。 Due to the override, your shell will retain its current effective execution policy of Unrestricted. 由于覆盖,您的外壳将保留其当前有效的执行策略“不受限制”。 Type "Get-ExecutionPolicy -List" to view your execution policy settings. 键入“ Get-ExecutionPolicy -List”以查看您的执行策略设置。 For more information please see "Get-Help Set-ExecutionPolicy". 有关更多信息,请参见“ Get-Help Set-ExecutionPolicy”。 Cannot type on the console. 无法在控制台上键入。

Here are some steps you may try: 您可以尝试以下一些步骤:

  1. Open a PowerShell window as Administrator 以管理员身份打开PowerShell窗口
  2. Type the following command: Set-ExecutionPolicy Unrestricted 键入以下命令: Set-ExecutionPolicy Unrestricted
  3. Confirm when asked with Y 确认时问Y
  4. Restart Visual Studio and retry the NuGet package install 重新启动Visual Studio并重试NuGet软件包安装
  5. Enjoy the HttpClient class brought to you by the newly installed NuGet 享受新安装的NuGet带给您的HttpClient

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM