IMPORTANT!
This forum is now archived. Click here for the New Support Forum
Problem with version 2.8
Quote from Ingo on August 24, 2019, 3:03 pmHi,
Unfortunately, I can not solve my present without your help! That's why I ask you to help me. I have a separate library where I send and receive SOAP jobs. This program works in a Thread.
If in my code:
var response = req.GetResponse ();the following happens. The mapper is called.
CreateMap<ApplicationRole, RoleViewModel>() .ForMember(d => d.Permissions, map => map.MapFrom(s => s.Claims)) .ForMember(d => d.UsersCount, map => map.MapFrom(s => s.Users != null ? s.Users.Count : 0)) .ReverseMap();Destination Member:
Permissions
---> System.InvalidOperationException: Mapper not initialized. Call Initialize with appropriate configuration. If you are trying to use mapper instances through a container or otherwise, make sure you do not have any calls to the static Mapper.Map methods, and if you're using ProjectTo or UseAsDataSource extension methods, make sure you pass in the appropriate IConfigurationProvider instance.
at AutoMapper.Mapper.get_Instance() in C:\projects\automapper\src\AutoMapper\Mapper.cs:line 36
Although I have found that the mapping is registered in the Start.cs.
services.AddIdentity<ApplicationUser, ApplicationRole>() .AddEntityFrameworkStores<ApplicationDbContext>() .AddDefaultTokenProviders();What can I do to make my program run again?
Hi,
Unfortunately, I can not solve my present without your help! That's why I ask you to help me. I have a separate library where I send and receive SOAP jobs. This program works in a Thread.
If in my code:
var response = req.GetResponse ();
the following happens. The mapper is called.
CreateMap<ApplicationRole, RoleViewModel>() .ForMember(d => d.Permissions, map => map.MapFrom(s => s.Claims)) .ForMember(d => d.UsersCount, map => map.MapFrom(s => s.Users != null ? s.Users.Count : 0)) .ReverseMap();
Destination Member:
Permissions
---> System.InvalidOperationException: Mapper not initialized. Call Initialize with appropriate configuration. If you are trying to use mapper instances through a container or otherwise, make sure you do not have any calls to the static Mapper.Map methods, and if you're using ProjectTo or UseAsDataSource extension methods, make sure you pass in the appropriate IConfigurationProvider instance.
at AutoMapper.Mapper.get_Instance() in C:\projects\automapper\src\AutoMapper\Mapper.cs:line 36
Although I have found that the mapping is registered in the Start.cs.
services.AddIdentity<ApplicationUser, ApplicationRole>() .AddEntityFrameworkStores<ApplicationDbContext>() .AddDefaultTokenProviders();
What can I do to make my program run again?
IMPORTANT!
This forum is now archived. Click here for the New Support Forum