I was getting same error with a .Net 8 Project. Luckily read the warning message that installed Automapper version is 14, but expected is 12.0.1. Using Nuget package I updated the version and the issue got resolved