原文章地址:http://www.codebye.com/vs2010-nuget-requires-powershell-2-0.html。
环境VS2010、XP系统,使用NuGet时出现错误:Error: The Package Manager Console requires PowerShell 2.0 runtime, which is not detected on this machine.
Please install the PowerShell 2.0 from http://support.microsoft.com/kb/968929 and restart Visual Studio.
错误显示在Package Manager Console,Package Manager Setting打开异常,总之工具-Library Package Manager中的功能都无法使用。
于是只能按照提示安装PowerShell 2.0。解决步骤:
由于电脑系统为XP,系统需要的PowerShell 2.0 地址为http://www.microsoft.com/downloads/details.aspx?FamilyId=60cb5b6c-6532-45e0-ab0f-a94ae9ababf5 (不同系统版本不同,对于XP即Windows XP 更新程序 (KB968930))。此更新的Windows Management Framework Core 程序包提供了适用于 IT 专业人员的已更新管理功能。
安装KB968930时需要Microsoft .NET Framework 2.0 Service Pack 1 (x86),地址:https://www.microsoft.com/zh-cn/download/confirmation.aspx?id=16614
以上安装完成后,重启VS2010,发现Nuget已经可以正常使用了。