I had this error because “Rebuild” was not really rebuilding.
Solution: Close Visual Studio, really go and delete the bin folder, then rebuild, it might work better.
Also, sometimes Visual Studio lies about references, so check the HintPath
in your .csproj
files.