Refresh Rider solution analysis after Git branch change
Sometimes non-existent errors are shown after changing branches while a solution is open in Rider.
Run this action:
Ctrl+Shift+A, "Reanalyze All"
Or invalidate the cache:
File > Invalidate Caches