Why does ExecutionPolicy behavior vary across projects in Visual Studio?

后端 未结 8 629
挽巷
挽巷 2020-12-07 12:46

I have been using NuGet for quite some time on a particular PC. Now, I created a new project in VS2010 (it\'s an MVC 4 Beta project using the Single Page App template if th

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-07 13:31

    I experienced the same problem and solved it by:

    • Opening Powershell as an Administrator
    • Entering the following command "Set-ExecutionPolicy RemoteSigned"
    • Restart Visual Studio and the Package Manager Console worked as expected

    It is important to note however that Powershell will give you a warning

    "The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic. Do you want to change the execution policy?"

    And should be careful of enabling this feature and should read more information in the help topics about the security risks.

提交回复
热议问题