Search code examples
angular.net-coreidentityangular-template

Visual studio angular template trying to add auto mapper


Im using the angular 8 template with identity that come with visual stuidio 19.

When i try to add automapper to the project and try to log in or requesta page with autentication i get an error.

these are the packages i added: enter image description here

i register in startup like this :

services.AddAutoMapper(cfg => cfg.AddProfile<MappingProfile>(),
                               AppDomain.CurrentDomain.GetAssemblies());

I have my MappingProfile in another project in the same solution (currently empty)

 public class MappingProfile : Profile
    {
        public MappingProfile()
        {
            
        }
    }

this is the error i get :

enter image description here


Solution

  • After Lucians comment for anyone else looking the correct versions for the template are:

    AutoMapper.Extensions.Microsoft.DependencyInjection = 7.0, Automapper = 9.0