Problem
I’m getting the below error while Adding the Mapper service in ConfigureService()
method in the asp.net core application
Solution
After adding the AutoMapper extensions for the ASP.NET Core dependency injection API NuGet package into the application Issue has been solved.
Install-Package AutoMapper.Extensions.Microsoft.DependencyInjection -Version 8.1.1
If you haven’t installed the package this is a mistake so, that the reason you are getting this error, while installing the package to your application make sure you are correctly installing it to your API or the respective application/project () by selecting the default project in package manager console window
Summary
until I added AutoMapper.Extensions.Microsoft.DependencyInjection NuGet package the same problem is popping up to me. After intslled the package, I was able to run the app. I hope you find them helpful.