Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
977 views
in Technique[技术] by (71.8m points)

c# - .NET core API scaffolding error "Package restore failed. Rolling back package changes for API", preventing me from scaffolding anything

I've recently tried to update one of my APIs and stumbled uppon the error: "Package restore failed. Rolling back package changes for API" while trying to scaffold a controller.

The API builds and rebuilds okay, all new scaffolding gets always rejected.

My current target framework is .Net core 3.1. My current package versions are 3.1.9 and 3.1.4. These packages always worked, even like a month or two ago when I was first building the API.

What i've tried:

  • Installing and uninstalling NuGet packages
  • Changing the versions of the packages
  • I cleared all the NuGet cache and rebuilt the API
  • I cleared all the NuGet cache and tried scaffolding without building
  • Restarted visual studio
  • Changed the target framework

What I've noticed is that when I try to scaffold, the version of microsoft.entityframeworkcore.sqlserver that copies locally is 3.1.10, but my NuGet manager version is 3.1.9.

When I only build the API the correct version gets copied, but as soon as I scaffold, the 3.1.10 copies again.

Nowhere in the NuGet manager have I selected the 3.1.0 version, neither is it specified in the dependecies. I assume the issue is somewhere here.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...