0

I'm attempting to use AutoMapper within Jobs hosted by Quartz.Net server. At service startup, I load all the mapping profiles, one of which has:

Mapper.CreateMap<Data.Models.ManufacturerAlias, Business.Models.ManufacturerAlias>();

In the Job, I call the Map<>, but I get the following error: Exception: AutoMapper.AutoMapperMappingException: Missing type map configuration or unsupported mapping. Mapping types: ManufacturerAlias -> ManufacturerAlias SmartBIM.Data.Models.ManufacturerAlias -> SmartBIM.Business.Models.ManufacturerAlias Destination path: ManufacturerAlias Source value: SmartBIM.Data.Models.ManufacturerAlias

Mapper.AssertConfigurationIsValid() is not giving me any exceptions.

Is this a threading issue - do I need to load the profiles at the Job.Execute()?

Thanks :)

Phil Boyd
  • 380
  • 3
  • 17

1 Answers1

0

Yes, it's threading issue. We had the similar. Static methods of AutoMapper are not thread-safe.

Backs
  • 24,430
  • 5
  • 58
  • 85