I had a similar problem. I was upgrading a nuget module (it happened to be EntityFramework) and I was getting the build error as described, but it was referencing an old version of the module.
I tried many of the potential solutions here, but none worked.
I had to manually edit the .csproj files and comment out all references to the old version of the module. That solved my issue.