When I try to pack my MVC project (NuGet.exe pack) I get:
NuGet.exe : Access to the path \'...\' is denied.
This happens to be
I ran into this with nuget restore after doing a git clean -fd with VisualStudio open: the packages/ directory was marked for deletion, and while several files were deleted, the packages/ folder itself was not as VisualStudio had the .nupkg files open.
Once I closed VisualStudio and re-ran git clean, it removed the packages/ directory and then nuget was able to restore everthing correctly.