本文介绍了程序包还原失败.在MVC Core中vs 2017中回滚'myproject'的软件包更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装VS 2017 15.3并创建新的MVC Core项目我尝试从程序包管理器控制台或管理NuGet程序包管理器"窗口安装每个新程序包,并尝试更新所有程序包或列出的某个程序包,这些程序包会在更新选项卡上显示,许多出现错误的时间:

I install VS 2017 15.3 and create new MVC Core project I try install each new package from package manager console or Manage NuGet package manager window and try to update all package or one of listed package, that show on update tab ,after many times I get that error :

尝试在MVC -web或API项目中重新创建新项目,并尝试更新所有程序包,但得到相同的错误.此错误仅在MVC内核中发生,我创建了MVC 5项目,一切正常.

Try to re create new project in MVC -web or API project - and try to update all package but get the same error. This error happen only in MVC core and I create MVC 5 project everything is Ok.

  1. 我清除了NuGet的所有缓存
  2. 添加 https://dotnet.myget.org/新获取的F/dotnet-core/api/v3/index.json

但是又遇到了最后一个错误,我该如何解决?

But have the last error again , how can I resolve that?

推荐答案

如果您具有最新的IDE,并且正在创建新的应用程序,则不必在创建项目后立即为其更新软件包.除非您要添加一些新的库,否则这些库不属于您选择的模板.

If you have the latest IDE, and you are creating a new application, you shouldn't have to update the packages for the project right after creating it. Not unless you are adding some new library that doesn't come as a part of the template you chose.

确定创建项目时是否在新建ASP.NET Core Web应用程序对话框中选择 ASP.NET Core 2.0 ?

Are you certain that you are choosing ASP.NET Core 2.0 in the New ASP.NET Core Web Application dialog when creating the projects?

如果在项目创建向导期间 ASP.NET Core 2.0 未显示在选项列表中,则您需要安装.Net Core 2.0 SDK .安装SDK后,您必须关闭并重新打开IDE才能看到新选项.没有SDK,您的任何项目都不会成功更新到Core 2.0.

If ASP.NET Core 2.0 doesn't show in the list of options during the project creation wizard, then you need to install the .Net Core 2.0 SDK. You will have to close and reopen the IDE after the SDK install to see the new option. Without the SDK, none of your projects will update to Core 2.0 successfully.

希望这会有所帮助;祝你好运!

Hope this helps; good luck!

这篇关于程序包还原失败.在MVC Core中vs 2017中回滚'myproject'的软件包更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 02:00