Package restore failed. Rolling back package changes for 'myproject' in vs 2017 in MVC Core

∥☆過路亽.° 提交于 2019-12-01 06:54:59

问题


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 :

Severity Code Description Project File Line Suppression State Error Package restore failed. Rolling back package changes for 'Sun'. 0

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. I clear All Cache of NuGet
  2. add https://dotnet.myget.org/F/dotnet-core/api/v3/index.json in new get

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


回答1:


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.

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?

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!



来源:https://stackoverflow.com/questions/45784052/package-restore-failed-rolling-back-package-changes-for-myproject-in-vs-2017

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!