Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuget add packages gives access denied errors

When I add Nuget packages via the Visual Studio 2015 GUI some packages don't install with the following error

Access to the path 'Microsoft.DotNet.InternalAbstractions.dll' is denied.

I tried running Visual Studio 2015 as Administrator and uninstalling the packages and adding them again but I still get the same error

like image 667
dev2go Avatar asked Jan 31 '17 07:01

dev2go


3 Answers

I closed Visual Studio and killed the 2 running processes called dotnet as well as deleted the C:\Users\myser.nuget\packages folder to ensure all packages are redownloaded again in case something was corrupt.

like image 181
dev2go Avatar answered Oct 06 '22 20:10

dev2go


Go to the dll path and make sure to give the right permission access to the local machine :

I usually do the below :

1- Untick the Read-only field :

enter image description here

2- Add the missing user access :

enter image description here

like image 26
Samidjo Avatar answered Oct 06 '22 20:10

Samidjo


This happened to me because I have cleared the NuGet cache.

I did the oldest trick in the book. I restarted my PC and then I was able to restore packages

like image 1
nak Avatar answered Oct 06 '22 20:10

nak