It usually happens because one of the following reasons:
- Entity Set is mapped from Database view
- A custom Database query
- Database table doesn’t have a primary key
After doing so, you may still need to update in the Entity Framework designer (or alternatively delete the entity and then add it) before you stop getting the error.