It looks like things are a bit easier now than they were before.
As other answer(s) have basically already stated, this error can result from an older version of the same NuGet package not having some of the newer types in it. While in production, this is generally managed through proper versioning, in development, you may end up reusing the same version number when making changes. And that's a likely place where this problem can arise.
To fix this, you can often just clear the cache by doing the following:
- In Visual Studio, go to
Tools > NuGet Package Manager > Package Manager Settings
.
- In the pop-up menu, navigate to
NuGet Package Manager > General
.
- In the options on the right, click
Clear All NuGet Cache(s)
.