从VS 2017 Developer命令提示符运行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,copyright,description,projectUrl,frameworkAssemblies,language,references,dependencies,iconUrl'。
答案 0 :(得分:0)
如何让nuget升级到最新版本?
您可以从VS 2017 Developer Command Prompt运行命令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
的新版本。
例如,我在路径4.1.0.2450
下有一个版本为D:\NuGet4.0
的nuget.exe,然后我将此路径设置为环境变量。之后,我可以在VS 2017开发人员命令提示符中将nuget.exe
本身更新为4.4.1
:
现在我们也可以使用命令nuget update -self
更新nuget本身。