Home > Blockchain >  Why am I getting errors when trying to restore NuGet packages in Visual Studio 2022?
Why am I getting errors when trying to restore NuGet packages in Visual Studio 2022?

Time:06-09

I have a .Net Core application using Visual Studio 2022. I am running into difficulties managing my NuGet packages.

When I attempt to do a NuGet package restore on the solution, I get the following error message:

NuGet package restore failed. Please see Error List window for detailed warnings and errors. Time Elapsed: 00:00:00.1126945 ========== Finished ========== Error occurred while restoring NuGet packages: The local source 'C:\Program Files (x86)\DevExpress 19.2.NET Core Desktop Libraries\System\Components\Packages' doesn't exist.

I tried clearing the cache from Tools->Options->NuGet Package Manager->Clear All NuGet Caches.

I also tried manually deleting my NuGet.config in my folder: C:\Users\foobar\AppData\Roaming\NuGet

I still get the same error.

DevExpress 19.2 is not used or referenced by any of the projects in my solution. At one point I had it installed on my machine, but removed it. I'm currently using the DevExpress 21.2.

I've been trying to figure this out for a couple of days. How do I fix this issue? Is there a cache somewhere that I am unaware of? Will I have to uninstall/reinstall Visual Studio?

CodePudding user response:

The error you're getting show a route: 'C:\Program Files (x86)\DevExpress 19.2.NET Core Desktop Libraries\System\Components\Packages' this is maybe beacuse you have it in your Package sources, you need to delete it from there and then restore the packages with the correct source:

enter image description here

  • Related