Why does ExecutionPolicy behavior vary across projects in Visual Studio?

后端 未结 8 630
挽巷
挽巷 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:29

    Since we needed to create a project on a share on a remote server in our network and ran into similar problems here's what worked:

    • map the share as a network drive, say R: (but I guess it would also work without this mapping)
    • open Internet options > Security > Local intranet > Sites > Advanced (via IE or control panel)
    • add either "R:" or "file://server.domain.xy" (the former will automatically turn into the latter once you reopen the dialog)
    • run the x86 PowerShell executable and do "Set-ExecutionPolicy RemoteSigned"

    Once I did all that Visual Studio didn't complain that the project was in an untrusted location upon opening the solution again, and it successfully ran all the PowerShell scripts for the packages that get auto-installed when creating a new MVC application.

提交回复
热议问题