I encountered the same error in Visual Studio 2022, and updating Entity Framework to version 6.5.1 resolved the issue.