Search code examples
c#.netvisual-studiorestwebapi

Install the Web API Client Libraries


enter image description here

I want to install 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. Getting this message:

Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. 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. For more information please see "Get-Help Set-ExecutionPolicy".

Cannot type on the console.


Solution

  • Here are some steps you may try:

    1. Open a PowerShell window as Administrator
    2. Type the following command: Set-ExecutionPolicy Unrestricted
    3. Confirm when asked with Y
    4. Restart Visual Studio and retry the NuGet package install
    5. Enjoy the HttpClient class brought to you by the newly installed NuGet