{"action":"created","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/855","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/855/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/855/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/855/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/855","id":103000295,"number":855,"title":"Bug Missing type map configuration or unsupported mapping","user":{"login":"utillity","id":5549814,"avatar_url":"https://avatars.githubusercontent.com/u/5549814?v=3","gravatar_id":"","url":"https://api.github.com/users/utillity","html_url":"https://github.com/utillity","followers_url":"https://api.github.com/users/utillity/followers","following_url":"https://api.github.com/users/utillity/following{/other_user}","gists_url":"https://api.github.com/users/utillity/gists{/gist_id}","starred_url":"https://api.github.com/users/utillity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/utillity/subscriptions","organizations_url":"https://api.github.com/users/utillity/orgs","repos_url":"https://api.github.com/users/utillity/repos","events_url":"https://api.github.com/users/utillity/events{/privacy}","received_events_url":"https://api.github.com/users/utillity/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-25T11:07:36Z","updated_at":"2015-08-26T18:35:32Z","closed_at":null,"body":"Hi,\r\n\r\nI have defined a mapping like below. When executing the mapping `var fdsFlight = Mapper.Map<DB.Flight>(saveCtx.SourceFlight, opt => opt.Items.Add(OptionSaveContext, saveCtx));` I get the exception listed below. \r\n\r\nAs you can see, it is trying to map my source flight Int32, instead of the target type. So I added another mapping `Mapper.CreateMap<Contract.Models.Flight, Int32>();` and suddenly the mapping works as expected (again).\r\n\r\n# Exception\r\n```C#\r\nAutoMapper.AutoMapperMappingException was unhandled by user code\r\n  HResult=-2146233088\r\n  Message=Missing type map configuration or unsupported mapping.\r\n\r\nMapping types:\r\nFlight -> Int32\r\nFM.Contract.Models.Flight -> System.Int32\r\n\r\nDestination path:\r\nFlight\r\n\r\nSource value:\r\nFM.Contract.Models.Flight\r\n  Source=AutoMapper\r\n  StackTrace:\r\n       bei AutoMapper.MappingEngine.AutoMapper.IMappingEngineRunner.Map(ResolutionContext context)\r\n       bei AutoMapper.ConstructorMap.ResolveValue(ResolutionContext context, IMappingEngineRunner mappingEngine)\r\n       bei AutoMapper.MappingEngine.AutoMapper.IMappingEngineRunner.CreateObject(ResolutionContext context)\r\n       bei AutoMapper.Mappers.TypeMapObjectMapperRegistry.NewObjectPropertyMapMappingStrategy.GetMappedObject(ResolutionContext context, IMappingEngineRunner mapper)\r\n       bei AutoMapper.Mappers.TypeMapObjectMapperRegistry.PropertyMapMappingStrategy.Map(ResolutionContext context, IMappingEngineRunner mapper)\r\n       bei AutoMapper.Mappers.TypeMapMapper.Map(ResolutionContext context, IMappingEngineRunner mapper)\r\n       bei AutoMapper.MappingEngine.AutoMapper.IMappingEngineRunner.Map(ResolutionContext context)\r\n       bei AutoMapper.MappingEngine.MapCore(Object source, Type sourceType, Type destinationType, MappingOperationOptions options)\r\n       bei AutoMapper.MappingEngine.Map(Object source, Type sourceType, Type destinationType, Action`1 opts)\r\n       bei AutoMapper.MappingEngine.Map[TDestination](Object source, Action`1 opts)\r\n       bei AutoMapper.Mapper.Map[TDestination](Object source, Action`1 opts)\r\n       bei FM.DP.Tests.FdsServiceTests.TestMapping() in c:\\DEV\\DPFM\\FM.DP.Tests\\FdsServiceTests.cs:Zeile 44.\r\n  InnerException: \r\n```\r\n\r\n# Mapping\r\n```C#\r\nstatic FdsService()\r\n{\r\n\tEnsureInitialized();\r\n}\r\n\r\npublic static void EnsureInitialized()\r\n{\r\n\tif (_initialized)\r\n\t\treturn;\r\n\t_initialized = true;\r\n\tMapper.CreateMap<Contract.Models.Flight, DB.Flight>()\r\n\t\t.ForMember(t => t.FlightId, opt => opt.ResolveUsing<FlightIdResolver>())\r\n\t\t.ForMember(t => t.ChecklistItems, opt => opt.ResolveUsing<ChecklistItemsResolver>())\r\n\t\t.ForMember(t => t.Coordinates, opt => opt.MapFrom(s => s.LocationGps))\r\n\t\t.ForMember(t => t.AircraftId, opt => opt.MapFrom(s => s.AircraftConfigurationId.Value))\r\n\t\t.ForMember(t => t.Location, opt => opt.ResolveUsing<LocationNameResolver>())\r\n\t\t.ForMember(t => t.Timers, opt => opt.ResolveUsing<TimersResolver>())\r\n\t\t.ForMember(t => t.TelemetryEntries, opt => opt.ResolveUsing<TelemetryEntriesResolver>())\r\n\t\t.ForMember(t => t.Remarks, opt => opt.ResolveUsing<RemarksResolver>())\r\n\t\t.ForMember(t => t.Xml, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.CreatedAt, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.Timestamp, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.Aircraft, opt => opt.Ignore())\r\n\t\t.AfterMap(EnsureCoordinates)\r\n\t\t.AfterMap(AddFlightPathsAsEvents)\r\n\t\t;\r\n\tMapper.CreateMap<FlightTimer, DB.FlightTimer>()\r\n\t\t.ForMember(t => t.Id, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.CreatedAt, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.Timestamp, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.Flight, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.FlightId, opt => opt.Ignore())\r\n\t\t;\r\n\tMapper.CreateMap<FlightEvent, DB.Event>()\r\n\t\t.ForMember(t => t.Id, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.CreatedAt, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.Timestamp, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.Flight, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.FlightId, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.FlightState, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.Message, opt => opt.MapFrom(s => string.IsNullOrEmpty(s.Message) ? s.ToString() : s.Message))\r\n\t\t.ForMember(t => t.EventUtc, opt => opt.MapFrom(s => s.EventOccuredUtc))\r\n\t\t.ForMember(t => t.FlightStateId, opt => opt.ResolveUsing<FlightStateIdResolver>())\r\n\t\t;\r\n\tMapper.CreateMap<Location, GeoCoordinate>()\r\n\t\t;\r\n\tMapper.CreateMap<Track, DB.Event>()\r\n\t\t.ForMember(t => t.Category, opt => opt.UseValue(\"Flight-Track\"))\r\n\t\t.ForMember(t => t.EventUtc, opt => opt.MapFrom(s => s.StartedAtUtc))\r\n\t\t.ForMember(t => t.Message, opt => opt.MapFrom(s => s.TrackName))\r\n\t\t.ForMember(t => t.Id, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.CreatedAt, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.Timestamp, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.Flight, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.FlightId, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.FlightState, opt => opt.Ignore())\r\n\t\t.ForMember(t => t.FlightStateId, opt => opt.Ignore())\r\n\t\t;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/comments/135133212","html_url":"https://github.com/AutoMapper/AutoMapper/issues/855#issuecomment-135133212","issue_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/855","id":135133212,"user":{"login":"utillity","id":5549814,"avatar_url":"https://avatars.githubusercontent.com/u/5549814?v=3","gravatar_id":"","url":"https://api.github.com/users/utillity","html_url":"https://github.com/utillity","followers_url":"https://api.github.com/users/utillity/followers","following_url":"https://api.github.com/users/utillity/following{/other_user}","gists_url":"https://api.github.com/users/utillity/gists{/gist_id}","starred_url":"https://api.github.com/users/utillity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/utillity/subscriptions","organizations_url":"https://api.github.com/users/utillity/orgs","repos_url":"https://api.github.com/users/utillity/repos","events_url":"https://api.github.com/users/utillity/events{/privacy}","received_events_url":"https://api.github.com/users/utillity/received_events","type":"User","site_admin":false},"created_at":"2015-08-26T18:35:32Z","updated_at":"2015-08-26T18:35:32Z","body":"I have one, but in my project - I can't compile AutoMapper because it uses syntax not known to my VS edition. I guess some kind of Post-Processor or something."}}