2013-01-04 112 views
5

執行從Windows 7 Pro到8 Pro的就地升級之後,我一直無法使NuGet的程序包管理器控制檯在Visual Studio 2012 Pro中運行。我收到的錯誤是:NuGet程序包管理器控制檯無法加載PowerShell

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在安全模式下
  • 設置電源外殼ExecutionProperty無限制

Visual Studio中已經表現出其他奇怪的行爲,如持續崩潰,而試圖添加Click事件的特定頁面的XAML爲好,正因爲如此,我的直覺認爲它不是Power Shell或NuGet,而是我的OS/Visual Studio的一個問題。

除非有人有解決方案,我想我只是做一個乾淨的Windows 8安裝,並希望修復它。

回答

相關問題