{"action":"created","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/885","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/885/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/885/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/885/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/885","id":106075713,"number":885,"title":"Invalid mapping of member variable with automapper 4.0.4","user":{"login":"paraglidernc","id":14240297,"avatar_url":"https://avatars.githubusercontent.com/u/14240297?v=3","gravatar_id":"","url":"https://api.github.com/users/paraglidernc","html_url":"https://github.com/paraglidernc","followers_url":"https://api.github.com/users/paraglidernc/followers","following_url":"https://api.github.com/users/paraglidernc/following{/other_user}","gists_url":"https://api.github.com/users/paraglidernc/gists{/gist_id}","starred_url":"https://api.github.com/users/paraglidernc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paraglidernc/subscriptions","organizations_url":"https://api.github.com/users/paraglidernc/orgs","repos_url":"https://api.github.com/users/paraglidernc/repos","events_url":"https://api.github.com/users/paraglidernc/events{/privacy}","received_events_url":"https://api.github.com/users/paraglidernc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-11T19:17:12Z","updated_at":"2015-09-11T19:33:09Z","closed_at":null,"body":"In 3.1.0 code below maps source.link to targetMember ( expected ). In 4.0.4 it maps to targetMemberBase:\r\n```\r\nusing AutoMapper;\r\nusing System;\r\n\r\nnamespace TestAutoMapper\r\n{\r\n    public class memberBase { }\r\n\r\n    public class member : memberBase{}\r\n\r\n    public class sourceBase\r\n    {\r\n        public memberBase link;\r\n    }\r\n    public class source : sourceBase{}\r\n\r\n    public class targetMemberBase{}\r\n    public class targetMember : targetMemberBase{}\r\n    public class targetBase\r\n    {\r\n        public targetMemberBase link;\r\n    }\r\n    public class target : targetBase{}\r\n    class Program\r\n    {\r\n        static void Main(string[] args)\r\n        {\r\n            Mapper.CreateMap<memberBase, targetMemberBase>()\r\n                .Include<member, targetMember>();\r\n\r\n            Mapper.CreateMap<member, targetMember>();\r\n\r\n            Mapper.CreateMap<sourceBase, targetBase>()\r\n                .Include<source, target>();\r\n\r\n            Mapper.CreateMap<source, target>();\r\n\r\n            var source = new source() { link = new member() };\r\n\r\n            var target = Mapper.Map<source, target>(source);\r\n\r\n            if (!(target.link is targetMember))\r\n                throw new Exception(\"should be targetMember\");\r\n\r\n        }\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/comments/139642450","html_url":"https://github.com/AutoMapper/AutoMapper/issues/885#issuecomment-139642450","issue_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/885","id":139642450,"user":{"login":"jbogard","id":104498,"avatar_url":"https://avatars.githubusercontent.com/u/104498?v=3","gravatar_id":"","url":"https://api.github.com/users/jbogard","html_url":"https://github.com/jbogard","followers_url":"https://api.github.com/users/jbogard/followers","following_url":"https://api.github.com/users/jbogard/following{/other_user}","gists_url":"https://api.github.com/users/jbogard/gists{/gist_id}","starred_url":"https://api.github.com/users/jbogard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbogard/subscriptions","organizations_url":"https://api.github.com/users/jbogard/orgs","repos_url":"https://api.github.com/users/jbogard/repos","events_url":"https://api.github.com/users/jbogard/events{/privacy}","received_events_url":"https://api.github.com/users/jbogard/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T19:33:09Z","updated_at":"2015-09-11T19:33:09Z","body":"Try this - can you put, after the last CreateMap, `Mapper.Configuration.Seal();`? Alternatively, use `Mapper.Initialize(cfg => { cfg.CreateMap<memberBase, targetMemberBase>(); /* etc */ })`."}}