Updated AutoMapper from 3 to 4 broke inheritance mapping
问题 I updated AutoMapper from 3.3.1 to 4.0.4 which broke the following mapping with this message Unable to cast object of type 'Foo' to type 'BarDTO' Classes public class FooDTO { // omitted } // derived DTO public class BarDTO : FooDTO { public string Extra { get; set; } } Mapping config Mapper.CreateMap<Foo, FooDTO>().ReverseMap(); Mapper.CreateMap<Foo, BarDTO>(); Mapping Map<Foo, BarDTO>(foo); // throws cast exception I also tried using the .Include() method, but didn't make a difference.