I've had this bug report a few times:
- Users are using a local package repository (\server\path)
- Their build server is writing a package to it over the WAN
- No one can list any packages from the repository because a file is locked
The errors occur because when trying to open a package for reading, NuGet doesn't allow sharing with a write lock on the file. Even if this is changed, OpenPackage fails if the package hasn't been fully written yet (e.g., the manifest might not have been written).
These errors mean the entire feed is unavailable rather than just the locked package.
My workaround is
. I'm simply ignoring packages that can't be read, making it more robust.