I had a similar error because of a mismatch between my PostgreSQL driver and my EF dependencies. Everything has to match.