1

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.

1 Answer 1

2

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
Sign up to request clarification or add additional context in comments.

4 Comments

how to open powershell window as an administrator?
Right click on the PowerShell icon on your Desktop and click Run as administrator. If you don't have a PowerShell icon on your Desktop, then probably that's something you should start caring about before getting into any serious development under the Windows operating system.
tried it in powershell. Attached the image in the question
You probably didn't run PowerShell as Administrator as I indicated in my answer. Even the error message you are getting in the screenshot you have shown is telling you so.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.