file cannot be loaded because the execution of scripts is disabled on this system

前端 未结 3 677
迷失自我
迷失自我 2021-01-14 16:29
File C:\\Users\\Acer\\Desktop\\Projelerim\\BEM_CANLI\\BEM\\packages\\EntityFramework.5.
0.0\\tools\\init.ps1 cannot be loade         


        
相关标签:
3条回答
  • 2021-01-14 16:37

    It's possible that you changed the execution policy for 64-bit powershell and the package manager is running 32-bit (or vice versa).

    I'd try opening 32-bit console (PowerShell (x86)) and setting the execution policy there, as the error is definitely pointing to that kind of resolution.

    0 讨论(0)
  • 2021-01-14 16:47

    Make sure you restart visual studio after changing execution policy so that changes can take effect. Also make sure you changed execution policy globally with administrator username and password.

    0 讨论(0)
  • 2021-01-14 16:52

    We have been facing the same issue today with Visual Studio 2017 and Entity Framework 6, and none of the solutions proposed here has worked. As a workaround, this is the temporary solution we found to be able to use Entity Framework commands in the Package Manager Console:

    Execute the following commands in the Package Manager Console

    Set-ExecutionPolicy -Scope Process Bypass
    Import-Module "your-solution-directory/packages/EntityFramework<your EF version>/EntityFramework.psd1"
    

    Actually, the Import-Module command is what the init1.ps1 script does.

    0 讨论(0)
提交回复
热议问题