'Visual Studio Nuget Update - Access denied to \packages\System.Security.Cryptography.X509Certificates.4.3.2\.signature.p7s is denied

Hi currently getting the above error when trying to restore or update packages via Nuget on VS2019 16.8.2.

The project was built on anothe rmachine then moved to a new machice, and im guessing its a permissions over the file issue, however, i have given full access to the files and still recive the error?

Any ideas, i have searched a lot on the topic but cant find anything that sorts the issue out?



Solution 1:[1]

Try these:

1) make sure that your OS account can access your solution folder

2) clean all nuget caches or delete all cache files under C:\Users\xxx\.nuget\packages.

3) Close VS Instance, delete the packages folder under your solution folder

4) run VS as Administrator and then reopen your project. run update-package -reinstall under Tools-->Nuget Package Manager--> Package Manager Console

Then, rebuild your project again.

Solution 2:[2]

I just:

1 - deleted the folder and 
2 - reopen visual studio and it worked fine.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mr Qian
Solution 2 Sterling Diaz