【问题标题】:Package Manager Console Not Working包管理器控制台不工作
【发布时间】:2015-08-24 20:41:49
【问题描述】:

我已广泛检查以下错误的解决方案,但无济于事。

在 Visual Studio 中打开包管理器控制台时,我收到一条错误消息,指出“加载格式数据文件时出错。路径 --> 到文件”无法加载,因为它的执行被软件限制策略阻止.如需更多信息,请联系您的管理员。

这些都是我为了纠正但失败而做的所有事情。

  1. 以管理员身份运行 Powershell。我在 powershell(x86)、powershell ISE (x86) 以及 64 位版本中将 ExecutionPolicy 设置为 RemoteSigned 和 Unrestricted。

  2. 以管理员身份运行 Powershell。我将进程、当前用户和本地机器的 ExecutionPolicy -范围设置为 RemoteSigned 和 Unrestricted。

  3. 重新安装 Visual Studio。

  4. 将注册表编辑器中的 ExecutionPolicy 设置为 RemoteSigned 和 Unrestricted。

但我仍然收到错误..有人可以帮忙..

谢谢

【问题讨论】:

    标签: visual-studio-2013 powershell-2.0


    【解决方案1】:

    如果您尝试了以下方法,请告诉我:

    PowerShell says "execution of scripts is disabled on this system."

    http://sqlish.com/file-ps1-cannot-be-loaded-because-the-execution-of-scripts-is-disabled-on-this-system-please-see-get-help-about_signing-for-more-details/

    Powershell profile.ps1 cannot be loaded because its operation is blocked by software restriction policies

    如果全部失败,请执行以下操作:

    您可能更改了 64 位的执行策略 powershell 和包管理器运行 32 位(反之亦然)。

    我会尝试打开 32 位控制台 (PowerShell (x86)) 并设置 那里的执行政策,因为错误肯定指向那个 一种分辨率。

    确保在更改执行策略后重新启动 Visual Studio,以便 更改可以生效。还要确保你改变了执行 使用管理员用户名和密码全局策略。

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

    【讨论】:

      【解决方案2】:

      作为一种解决方法,我找到了这个解决方案(更多详细信息请访问stackoverflow.com/a/53433786/8358565)

      在包管理器控制台中执行以下命令

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

      【讨论】:

        猜你喜欢
        • 2011-11-09
        • 2011-07-10
        • 2013-01-03
        • 1970-01-01
        • 2018-04-29
        • 1970-01-01
        • 1970-01-01
        • 2011-04-23
        相关资源
        最近更新 更多