I've had this several times now with different packages (Latest was System.ValueTuple) installed using the nuget package manager in Visual Studio.
After doing some upgrading of various packages I find that, although the project builds fine, after deploying I get error messages about not being able to find a file with a specified version.
When looking into it, it always seems that the problem is that the packages.config is correct for the version I've just updated to in nuget but the app.config has a section for that package with a "oldVersion" property with the highest value lower than the version installed (leading to this error).
Is there a way to force the app.configs in a solution to update their "oldVersion" and "newVersion" properties to match the installed version from nuget?
The only workaround I've found for this is to remove the offending section for that package. This is fine but it takes ages to do in a large solution and I'm also concerned that I might be breaking it by doing this.
I think I found the answer after (a lot!) more searching here:
https://stackoverflow.com/a/64047575/3663863
Although the better option might be to move away from packages.config or find better nuget libraries that don't have so many old dependencies as suggested in comments, I suspect I'm like a lot of people - stuck with what I've got and just needing to fix it.
The original blog post that answer links to is worth a read, as well as the one it got the answer from found here: