solving Missing type map configuration or unsupported mapping error of automapper in c#

Recently working in my project I came across error “Missing type map configuration or unsupported mapping” while mapping two objects using Automapper.

After some googling I found answer & it is very easy.

So,

How to solve Missing type map configuration or unsupported mapping error in automapper?

Full error was

Missing type map configuration or unsupported mapping.

Mapping types:
Point -> PointData
RouteLib.DTO.Point -> RouteHostService.DTO.PointData

Destination path:
PointData

Source value:
RouteLib.DTO.Point

The error was because I was using Mapper.Map. i.e.

pointList.Add(AutoMapper.Mapper.Map<Point,PointData>(point));

Just replaced Mapper.Map with Mapper.DynamicMap i.e.

pointList.Add(AutoMapper.Mapper.DynamicMap<Point,PointData>(point));

It will solve your error & auto mapper will work very nicely.

admin