Search code examples
nugetnuget-packagenuget-server

NuGet packages get stale? "Failed to download package correctly. The contents of the package could not be verified"


We're experiencing a strange issue with our local NuGet package server. Over time, it appears that packages become unavailable, and the only fix seems to be touching the .nupkg file (e.g., just opening the file in Package Explorer) or just create a new build / version of the package.

Here's a picture of the error that comes back:

Failed to verify package contents

We're using IIS6 to host the NuGet server, using the latest NuGet packages for the server (server and core version 1.5.20902.9026)

Does anyone know what's going on and how to fix it for good?


Solution

  • This is actually a bug in NuGet.Server. There's a race condition that causes the feed to get a stale hashcode. You can follow the various discussions about it on nuget.