If you are using the following combination of tools:

  • Visual Studio 2012
  • Visual Studio Tools for Git
  • Nuget

Then you may encounter some weird problems when trying to update Nuget packages. For me, updates regularly fail with:

Recursive read lock acquisitions not allowed in this mode.

I'm lost on the root cause of this, but it does seem that the project I'm working on has files set to read-only by something regularly, perhaps Visual Studio is trying to make Git more TFS-y by locking things all over the place. Whatever the cause, I've found that the following usually helps:

  1. Don't use Update-Package - use Install-Package instead.
  2. Make sure the solution has all of its files read+write, not read only.
  3. Open the team explorer and go to 'Commits' - making sure that the Git tools have loaded various components.

This combination of tricks seems to solve the problem. If anyone has any other ideas or suggestions, just comment.