{"action":"created","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/879","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/879/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/879/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/879/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/879","id":105868662,"number":879,"title":"Error mapping object","user":{"login":"Borgas77","id":3596905,"avatar_url":"https://avatars.githubusercontent.com/u/3596905?v=3","gravatar_id":"","url":"https://api.github.com/users/Borgas77","html_url":"https://github.com/Borgas77","followers_url":"https://api.github.com/users/Borgas77/followers","following_url":"https://api.github.com/users/Borgas77/following{/other_user}","gists_url":"https://api.github.com/users/Borgas77/gists{/gist_id}","starred_url":"https://api.github.com/users/Borgas77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Borgas77/subscriptions","organizations_url":"https://api.github.com/users/Borgas77/orgs","repos_url":"https://api.github.com/users/Borgas77/repos","events_url":"https://api.github.com/users/Borgas77/events{/privacy}","received_events_url":"https://api.github.com/users/Borgas77/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":42,"created_at":"2015-09-10T18:24:26Z","updated_at":"2015-11-27T14:00:22Z","closed_at":null,"body":"![image](https://cloud.githubusercontent.com/assets/3596905/9796793/390e6148-57f8-11e5-8695-5651a3a24b5f.png)\r\n![image](https://cloud.githubusercontent.com/assets/3596905/9796929/e8a50af8-57f8-11e5-8f9a-531b9f81149b.png)\r\n\r\n\r\nWe have an strange problem. after a while we are not able to map objects.\r\nThe reason is that automapper is finding wrong typemap\r\n\r\nI try to map From object \"BOB.DO.Response.AssignmentRow.Server\" To \"BOB.DO.Response.AssignmentRow.Client\"\r\n\r\nWhen we try to find an already initilized map it finds wrong one.\r\nIt finds \r\nFrom object \"{BOB.DO.Response.DOResponseBase}\" To object \"{BOB.DO.Response.AssignmentRow.Client}\"\r\n\r\n\r\nMy Class object for BOB.DO.Response.AssignmentRow.Server looks like this\r\n```\r\nnamespace BOB.DO.Response.AssignmentHead\r\n{\r\n    public class Server : BOB.DO.Response.AssignmentHead.Client\r\n    {\r\n Properties.......\r\n     }\r\n}\r\n\r\n\r\nnamespace BOB.DO.Response.AssignmentHead\r\n{\r\n    [DataContract(Name = \"Response_AssignmentHead_Client\")]\r\n    public class Client : BOB.DO.Response.DOResponseAssignmentBase\r\n    {\r\n Properties.......\r\n    }\r\n}\r\n\r\n\r\nnamespace BOB.DO.Response\r\n{\r\n    [DataContract(Name = \"Response_AssignmentBase\")]\r\n    public class DOResponseAssignmentBase : BOB.DO.Response.DOResponseNavigationBase\r\n    {\r\n Properties.......  \r\n    }\r\n}\r\n\r\n\r\nnamespace BOB.DO.Response\r\n{\r\n    [DataContract(Name = \"Response_NavigationBase\")]\r\n    public class DOResponseNavigationBase : BOB.DO.Response.DOResponseBase\r\n    {\r\n Properties.......  \r\n    }\r\n}\r\n\r\n\r\nnamespace BOB.DO.Response\r\n{\r\n    [DataContract(Name = \"Response_ResponseBase\")]\r\n    public class DOResponseBase : DOBase\r\n    {\r\n Properties.......  \r\n    }\r\n}\r\n\r\n\r\nnamespace BOB.DO\r\n{\r\n    [DataContract(Name = \"Base\")]\r\n    public class DOBase\r\n    {\r\n Properties.......  \r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/comments/160145488","html_url":"https://github.com/AutoMapper/AutoMapper/issues/879#issuecomment-160145488","issue_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/879","id":160145488,"user":{"login":"lbargaoanu","id":4517428,"avatar_url":"https://avatars.githubusercontent.com/u/4517428?v=3","gravatar_id":"","url":"https://api.github.com/users/lbargaoanu","html_url":"https://github.com/lbargaoanu","followers_url":"https://api.github.com/users/lbargaoanu/followers","following_url":"https://api.github.com/users/lbargaoanu/following{/other_user}","gists_url":"https://api.github.com/users/lbargaoanu/gists{/gist_id}","starred_url":"https://api.github.com/users/lbargaoanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbargaoanu/subscriptions","organizations_url":"https://api.github.com/users/lbargaoanu/orgs","repos_url":"https://api.github.com/users/lbargaoanu/repos","events_url":"https://api.github.com/users/lbargaoanu/events{/privacy}","received_events_url":"https://api.github.com/users/lbargaoanu/received_events","type":"User","site_admin":false},"created_at":"2015-11-27T14:00:22Z","updated_at":"2015-11-27T14:00:22Z","body":"@Borgas77 Now, about the original problem, in your first message :) That's expected behavior for DynamicMap, because Server is derived from DOResponseBase and when you first map from DOResponseBase to Client, that map is cached and reused when later you map from Server to Client. The only way I know to override this is to create the maps beforehand and use Mapper.Map instead. I believe it can be done with reflection and the non generic CreateMap."}}