包还原的 Nuget 版本控制问题 [英] Nuget versioning issue with package restore

查看:62
本文介绍了包还原的 Nuget 版本控制问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于 Nuget 的某种版本控制问题,我无法安装包(使用包还原).以下是我采取的步骤:

I am unable to install a package (using package restore) due to some kind of versioning issue with Nuget. Here are the steps I took:

构建项目:错误:MagicalUnicorn.MvcErrorToolkit"的架构版本与 NuGet 版本 1.6.21205.9031 不兼容.请将 NuGet 从 http://go.microsoft.com/fwlink/?LinkId 升级到最新版本=213942.

build project: error : The schema version of 'MagicalUnicorn.MvcErrorToolkit' is incompatible with version 1.6.21205.9031 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942.

扩展管理器说版本是:2.0.30619.9119.

Extension manager says version is: 2.0.30619.9119.

好的,以管理员身份重启VS,扩展管理器卸载nuget.再次以管理员身份重启VS,搜索nuget并安装.

Ok, restart VS as administrator, extension manager uninstall nuget. restart VS as administrator again, search for nuget and install.

扩展管理器再次说版本是:2.0.30619.9119.

Extension manager again says version is: 2.0.30619.9119.

重建项目:错误:MagicalUnicorn.MvcErrorToolkit"的架构版本与 NuGet 版本 1.6.21205.9031 不兼容.请将 NuGet 从 http://go.microsoft.com/fwlink/?LinkId 升级到最新版本=213942.

rebuild project: error : The schema version of 'MagicalUnicorn.MvcErrorToolkit' is incompatible with version 1.6.21205.9031 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942.

好的,那么以管理员身份重新启动VS,扩展管理器再次卸载nuget.这次从 http://visualstudiogallery.msdn.microsoft.com/27077b70 下载-9dad-4c64-adcf-c7cf6bc9970c运行安装程序,一切正常.

Ok, so restart VS as administrator, extension manager uninstall nuget again. This time download from http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c Run the installer, all seems ok.

扩展管理器再次说版本是:2.0.30619.9119.

Extension manager again says version is: 2.0.30619.9119.

重建项目:错误:MagicalUnicorn.MvcErrorToolkit"的架构版本与 NuGet 版本 1.6.21205.9031 不兼容.请将 NuGet 从 http://go.microsoft.com/fwlink/?LinkId 升级到最新版本=213942.

rebuild project: error : The schema version of 'MagicalUnicorn.MvcErrorToolkit' is incompatible with version 1.6.21205.9031 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942.

呸!有什么想法吗?

推荐答案

看起来像是 nuget 命令行工具中的问题.当您启用Nuget 包还原"功能时,它会使用 nuget.exe 将 .nuget 文件夹添加到您的解决方案中.当您编译项目时,此工具用于下载丢失的包,而不是此处使用 VS 扩展名.所以尝试从命令行更新这个工具:

It looks like problem in nuget command line tool. When you enable 'Nuget package restore' feature it adds .nuget folder to you solution with nuget.exe. And when you compile project this tool is using to download missing packages, not VS extension is used here. So try update this tool from command line:

cd .nuget
nuget.exe update -Self

程序截图:

这篇关于包还原的 Nuget 版本控制问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆