2013-01-04 60 views
5

Sau khi thực hiện nâng cấp tại chỗ từ Windows 7 Pro lên 8 Pro, tôi không thể tải bảng điều khiển quản lý gói của NuGet để chạy trong Visual Studio 2012 Pro. Lỗi tôi nhận được là:NuGet Package Manager Console không thể tải 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. 

Tôi đã tìm kiếm vài ngày qua để khắc phục vấn đề này nhưng đã hoàn toàn trống. Tôi đã thử tất cả những việc này với vô ích:

  • Vô hiệu hóa tất cả Visual Studio add ons
  • Reset tất cả các thiết lập
  • Cài đặt lại Visual Studio
  • Sửa chữa Visual Studio
  • Bắt đầu PowerShell trước khi Visual Studio (Liệu điều này chỉ có nghĩa là khởi động PowerShell và sau đó khởi động Visual Studio?)
  • Chạy cả PowerShell và Visual Studio dưới dạng quản trị viên
  • Chạy Visual Studio ở chế độ an toàn
  • Thiết Power Shell ExecutionProperty để hạn chế

Visual Studio đã được trưng bày những hành vi kỳ quặc khác như liên tục đâm khi đang cố gắng thêm một sự kiện Click để XAML trên một trang cụ thể là tốt, và vì điều này ruột của tôi nói rằng nó không thực sự Power Shell hoặc NuGet nhưng một vấn đề với hệ điều hành của tôi/Visual Studio.

Trừ khi có ai đó có giải pháp, tôi nghĩ tôi sẽ chỉ thực hiện cài đặt sạch Windows 8 và hy vọng rằng việc đó sẽ được sửa chữa.

Trả lời

4

tôi thấy vấn đề này rất giống như của bạn:

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

Bạn có thể thử các giải pháp về câu hỏi đó để xem nếu nó sửa chữa nó?

+0

Tôi thấy rằng phương pháp đó cũng đã thử và không có may mắn. Tôi cuối cùng đã bỏ và chỉ cần cài đặt sạch Win8 mà cố định nó rõ ràng. –

Các vấn đề liên quan