Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AddAutoMapper not found in .NET Core with AutoMapper

Using Visual Studio 2019 I installed AutoMapper version 8.1.0 via NuGet. When I try to add the services.AddAutoMapper() call though in my Startup.cs file I get a compiler error that the method doesn't exist.

I've already tried to do a dotnet clean and dotnet restore from the NuGet console but that didn't help.

like image 318
Gargoyle Avatar asked May 19 '19 20:05

Gargoyle


1 Answers

It is an old thread, however the solution for this problem is to install Automapper.Extensions.Microsoft.DependencyInjection package along with your automapper package. I hope it helps.

like image 104
payam ardeshirzad Avatar answered Sep 23 '22 11:09

payam ardeshirzad