【问题标题】:nuget update -self errornuget update -self 错误
【发布时间】:2018-01-15 05:58:59
【问题描述】:

从 VS 2017 开发人员命令提示符运行 nuget update -self 我遇到了以下错误。如何让 nuget 自行升级到最新版本?

正在检查来自https://nuget.org/api/v2/ 的更新。

当前正在运行 NuGet.exe 2.0.30619.9000。

将 NuGet.exe 更新到 4.4.1。

命名空间“http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd”中的元素“元数据”在命名空间“http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd”中具有无效的子元素“developmentDependency”。预期的可能元素列表:命名空间“http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd”中的“标题、标签、摘要、licenseUrl、releaseNotes、版权、描述、projectUrl、frameworkAssemblies、语言、引用、依赖项、iconUrl”。

【问题讨论】:

    标签: nuget visual-studio-2017


    【解决方案1】:

    如何让 nuget 自行升级到最新版本?

    您可以从 VS 2017 开发人员命令提示符运行命令 nuget update -self 而不会出现以下错误:

    'nuget' 不是内部或外部命令,可操作 程序或批处理文件。

    这意味着你应该在环境变量之前添加一个nuget.exe的路径,或者你在路径C:\Users\bboyl\Source下有一个旧的nuget.exe。

    如果您想更新 nuget 本身,您可以手动下载更新版本的表单 nuget.org,在标题为“Windows x86 Commandline”的部分下,替换PC 路径中的旧版本。

    BTW,系统环境变量路径的nuget.exe版本2.0.30619.9000好像太低,无法自动更新。所以我们必须手动更新它,只需下载nuget.exe的新版本即可。

    例如,我在路径D:\NuGet4.0下有一个版本为4.1.0.2450的nuget.exe,然后我将此路径设置为环境变量。之后,我可以在 VS 2017 开发人员命令提示符中将 nuget.exe 本身更新为 4.4.1

    现在我们还可以使用命令 nuget update -self 更新 nuget 本身。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-11
      • 2015-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-07
      • 2016-01-06
      相关资源
      最近更新 更多