问题
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.
- I clear All Cache of NuGet
- 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