【问题标题】:NuGet Package Manager Console unable to load PowerShellNuGet 包管理器控制台无法加载 PowerShell
【发布时间】:2012-12-19 02:42:47
【问题描述】:

执行从 Windows 7 Pro 到 8 Pro 的就地升级后,我无法让 NuGet 的包管理器控制台在 Visual Studio 2012 Pro 中运行。我收到的错误是:

The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\WINDOWS\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2977) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\WINDOWS\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2984) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\WINDOWS\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2991) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\WINDOWS\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2998) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\WINDOWS\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(3005) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The term 'Get-ExecutionPolicy' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

过去几天我一直在寻找解决此问题的方法,但一无所获。我已经尝试了所有这些都无济于事:

  • 禁用所有 Visual Studio 插件
  • 重置所有设置
  • 重新安装 Visual Studio
  • 修复 Visual Studio
  • 在 Visual Studio 之前启动 PowerShell(这只是意味着先启动 PowerShell,然后再启动 Visual Studio?)
  • 以管理员身份运行 PowerShell 和 Visual Studio
  • 在安全模式下运行 Visual Studio
  • 将 Power Shell ExecutionProperty 设置为不受限制

Visual Studio 一直表现出其他奇怪的行为,例如在尝试将 Click 事件添加到特定页面上的 XAML 时始终崩溃,因此我的直觉说这不是真正的 Power Shell 或 NuGet,而是我的问题操作系统/Visual Studio。

除非有人有解决方案,否则我认为我只能全新安装 Windows 8 并希望能够解决它。

【问题讨论】:

    标签: visual-studio powershell nuget


    【解决方案1】:

    我发现这个问题和你的很相似:

    Embedding Powershell v2.0 in .NET app on Windows 8 RTM

    您能否尝试解决该问题,看看是否能解决问题?

    【讨论】:

    • 我也发现了这种方法,但没有成功。我终于放弃了,只是清理安装了 Win8,它显然修复了它。
    猜你喜欢
    • 2013-01-08
    • 1970-01-01
    • 1970-01-01
    • 2014-07-24
    • 2015-11-18
    • 2015-06-21
    • 2019-11-12
    • 2013-05-01
    • 2015-10-10
    相关资源
    最近更新 更多