I’m getting the below error when I trying to add the NewtonsoftJson package to asp.net web API core 3.1 project
Package restore failed. Rolling back package changes
It was an issue while installing the NewtonsoftJson package to my asp.net core API 3.1v project, so I tried to clear the cache of the All NuGet packages and restarted the visual studio.
After I cleared the cache, I was able to download the NuGet package API into my asp.net core project.
Clear of NuGet packages cache can also solve the problems when we are failing to install the new NuGet packages to our asp.net core projects.