NuGet使用问题

This package (or one of its dependencies) contains PowerShell scripts but the PowerShell 2.0 (or newer) runtime is not installed on this machine.

以上情况出现在Windows XP SP3, Visual Studio 2010, NuGet1.2.20325.9034安装好的情况下,对程序依赖包进行更新时发生的。

以下是搜索信息的结果:

http://nuget.codeplex.com/workitem/530

I eventually discovered the cause of the error: I didn't have PowerShell installed. The Package Manager Console was able to give me a reasonable error explaining exactly what was wrong ("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."). After I installed PowerShell, the Package Manager Console started working, and the Add Library Package Reference dialog started working as well.

http://stackoverflow.com/questions/4572594/nuget-unable-to-load-one-or-more-of-the-requested-types

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.

根据以上信息,进入http://support.microsoft.com/kb/968929

立即下载 Windows 管理框架核心的 Windows XP 和 Windows Embedded 程序包。

下载 http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=16818

安装。重新启动VS2010.

----

将NuGet升级到1.6,以上问题消失。

但,没有测试过如果不安装PowerShell,直接将NuGet升级到1.6,是否就没有上述问题产生。

原文地址:https://www.cnblogs.com/alphaqiu/p/2376232.html