{"action":"closed","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1776","repository_url":"https://api.github.com/repos/AutoMapper/AutoMapper","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1776/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1776/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1776/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/1776","id":187159098,"number":1776,"title":"Property '...' is not defined for type '...'","user":{"login":"jwwelbor","id":1625728,"avatar_url":"https://avatars.githubusercontent.com/u/1625728?v=3","gravatar_id":"","url":"https://api.github.com/users/jwwelbor","html_url":"https://github.com/jwwelbor","followers_url":"https://api.github.com/users/jwwelbor/followers","following_url":"https://api.github.com/users/jwwelbor/following{/other_user}","gists_url":"https://api.github.com/users/jwwelbor/gists{/gist_id}","starred_url":"https://api.github.com/users/jwwelbor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwwelbor/subscriptions","organizations_url":"https://api.github.com/users/jwwelbor/orgs","repos_url":"https://api.github.com/users/jwwelbor/repos","events_url":"https://api.github.com/users/jwwelbor/events{/privacy}","received_events_url":"https://api.github.com/users/jwwelbor/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-11-03T18:54:46Z","updated_at":"2016-12-29T21:58:14Z","closed_at":"2016-12-29T21:58:14Z","body":"I'm upgrading from a working version 3 to 5 with a ridiculous number of maps defined, so I won't bother to post them here.\r\n\r\nI've moved my staticy configs into profiles, and then included them like this.\r\n\r\n```\r\npublic static MapperConfiguration Configure()\r\n        {\r\n            var mappings = new MapperConfiguration(config =>\r\n            {\r\n                config.AddProfile<MapperConfigDomain>();\r\n                config.AddProfile<MapperConfigModels>();\r\n                config.AddProfile<MapperConfigDTO>();\r\n                config.AddProfile<MapperConfigExternalServices>();\r\n            });\r\n\r\n\r\n            return mappings;\r\n        }\r\n```\r\nThen moved all of the random CreateMap calls that had been leaked all over into the expected locations.\r\n\r\nI'm finally in a compiling state.\r\n\r\nBut when I try to load the configuration to run a unit test I get\r\n\r\n **{\"Property _xxx_ is not defined for type _yyy_\"}**\r\n\r\n\r\n\r\nNow, the problem is, that it absolutely exists.  At first I thought it was because of a nullable type, but then I completely commented that out as a test and it went on to complain about a bool.  \r\n\r\nThe properties are named exactly the same and are there across all objects.  Have any of you encountered this?  It does seem like maybe it has something to do with mappings from an interface to a concrete?\r\n\r\nDid something change with how this works?\r\n\r\nFor example..\r\n```\r\n            CreateMap<ApplicationVehicleModel, ApplicationVehicle>().ReverseMap();\r\n\r\n\r\n            CreateMap<IApplicationVehicleModel, ApplicationVehicle>()\r\n                    .ForMember(dest => dest.Id, opt => opt.Ignore()).ReverseMap();\r\n\r\n\r\n            CreateMap<ApplicationVehicleModel, VehicleViewModel>().ReverseMap();\r\n\r\n\r\n            CreateMap<ApplicationVehicle, VehicleViewModel>().ReverseMap();\r\n\r\n\r\n            CreateMap<IVehicleModel, Vehicle>()\r\n                .ForMember(dest => dest.Id, opt => opt.Ignore())\r\n                .ForMember(dest => dest.ClientId, opt => opt.Condition(x => x.ClientId > 0))\r\n            .ReverseMap()\r\n                .ForMember(dest => dest.Id, opt => opt.Ignore())\r\n                .ForMember(dest => dest.ClientId, opt => opt.Condition(x => x.ClientId > 0));\r\n```\r\n\r\nWhen MapperConfiguration returns I get the following error\r\n\r\n**{\"Property 'Boolean IsExotic' is not defined for type 'Web.Models.VehicleViewModel'\"}**\r\n\r\n```\r\npublic class ApplicationVehicleModel : VehicleViewModel, IApplicationHeaderModel, IApplicationVehicleModel\r\n\r\npublic class VehicleViewModel {\r\n     public bool IsExotic { get; set; }\r\n     ...\r\n}\r\n\r\npublic class ApplicationVehicle {\r\n     public bool IsExotic { get; set; }\r\n     ...\r\n}\r\n\r\npublic interface IVehicleModel{\r\n     bool IsExotic { get; set; }\r\n     ...\r\n}\r\n\r\npublic class Vehicle {\r\n     public bool IsExotic { get; set; }\r\n\r\n}\r\n```\r\n\r\nAny suggestions?  Could it be related to inheritance? Or due to mapping from an interface to an unrelated concrete?"}}
{"actor":{"display_login":"jbogard"}}