19

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

4 Answers 4

33

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for sharing your answer here. Please mark your answer which is benefit to other communities who has the same problem.
Infinite thanks, Sir ! Glad you answered your own question.
Thanks. Get-Process -Name *dotnet* | kill helped me.
5

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

2 Comments

I also had to untick the 'Hidden' in order for it to work.
Good luck if the dll path is not there.
5

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

Comments

0

I close my Visual Studio.. and start it again as an administrator... It Worked.

1 Comment

And from then on you could use it as normal user? Or are you recommending to always run as an administrator? That would seem of questionable wisdom to me, especially becaue it seems from other answers that the solution is possible on configuration level.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.