Problem with NuGet in Visual Studio

Topics: General
Dec 28, 2012 at 4:53 AM

I just recently upgrade my laptop from Windows Vista to Windows 7 so that I can use Visual Studio 2012 on it. I just attempted to create a new ASP.NET MVC 4 project, but it would not add some of the NuGet packages that come with it, specifically EntityFramework. When attempting to install the package through the NuGet manager, I get the following error:

Failed to initialize the PowerShell host. If your PowerShell execution policy is set to AllSigned, open the Package Manager Console to initialize the host first.

Now, when I open the Package Manager Console, I get the following error from there:

The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\System32\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\System32\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\System32\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\System32\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\System32\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.

The prompt never appears, so the Console is essentially unusable.

Now, I have tried several possible remedies, but to no avail. So, does anyone have any ideas as to how to resolve this issue?

Thanks in advance!

Developer
Dec 28, 2012 at 3:58 PM

What other VS extensions do you install? We've seen this error when some VS extension is installed and interferes with NuGet. I'd try disabling other extensions, then reload VS. Hope it'll fix your problem.

Jan 1, 2013 at 2:11 PM

I tried all of this and I still have the problem.  Please note that I am experiencing this in both VS 2010 and 2012.  Also, this computer has been upgraded from Windows Vista.  I attempted to install Windows 8 on it, but that would not work.  Additionally, my computer is an Inspiron 1525 from Dell, which does not support Windows 7 on this computer.