{"action":"closed","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1518","repository_url":"https://api.github.com/repos/AutoMapper/AutoMapper","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1518/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1518/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1518/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/1518","id":165352405,"number":1518,"title":"Index was outside the bounds of the array.","user":{"login":"niemyjski","id":1020579,"avatar_url":"https://avatars.githubusercontent.com/u/1020579?v=3","gravatar_id":"","url":"https://api.github.com/users/niemyjski","html_url":"https://github.com/niemyjski","followers_url":"https://api.github.com/users/niemyjski/followers","following_url":"https://api.github.com/users/niemyjski/following{/other_user}","gists_url":"https://api.github.com/users/niemyjski/gists{/gist_id}","starred_url":"https://api.github.com/users/niemyjski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niemyjski/subscriptions","organizations_url":"https://api.github.com/users/niemyjski/orgs","repos_url":"https://api.github.com/users/niemyjski/repos","events_url":"https://api.github.com/users/niemyjski/events{/privacy}","received_events_url":"https://api.github.com/users/niemyjski/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-07-13T15:36:36Z","updated_at":"2016-07-13T21:17:22Z","closed_at":"2016-07-13T21:17:22Z","body":"I'm still investigating this issue but I wanted to log it and get the ball rolling...\r\n\r\n```csharp\r\n            container.RegisterSingleton<IMapper>(() => {\r\n                var profiles = container.GetAllInstances<Profile>();\r\n                var config = new MapperConfiguration(cfg => {\r\n                    cfg.ConstructServicesUsing(container.GetInstance);\r\n\r\n                    foreach (var profile in profiles)\r\n                        cfg.AddProfile(profile);\r\n                }); // blows up here..\r\n                return config.CreateMapper();\r\n            });\r\n```\r\n\r\nI only have one mapping and this seems to be created okay..\r\n\r\n```csharp\r\n\r\n        public class ApiMappings : Profile {\r\n            public ApiMappings() {\r\n                CreateMap<UserDescription, EventUserDescription>();\r\n                \r\n                CreateMap<NewOrganization, Organization>();\r\n                CreateMap<Organization, ViewOrganization>().AfterMap((o, vo) => {\r\n                    vo.IsOverHourlyLimit = o.IsOverHourlyLimit();\r\n                    vo.IsOverMonthlyLimit = o.IsOverMonthlyLimit();\r\n                });\r\n\r\n                CreateMap<StripeInvoice, InvoiceGridModel>().AfterMap((si, igm) => igm.Id = igm.Id.Substring(3));\r\n\r\n                CreateMap<NewProject, Project>();\r\n                CreateMap<Project, ViewProject>();\r\n\r\n                CreateMap<NewToken, Token>().ForMember(m => m.Type, m => m.Ignore());\r\n                CreateMap<Token, ViewToken>();\r\n                \r\n                CreateMap<User, ViewUser>();\r\n\r\n                CreateMap<NewWebHook, WebHook>();\r\n            }\r\n        }\r\n```\r\n\r\n```\r\nSystem.IndexOutOfRangeException occurred\r\n  HResult=-2146233080\r\n  Message=Index was outside the bounds of the array.\r\n  Source=AutoMapper\r\n  StackTrace:\r\n       at AutoMapper.Mappers.CollectionMapperExtensions.MapKeyPairValueExpr(TypeMapRegistry typeMapRegistry, IConfigurationProvider configurationProvider, PropertyMap propertyMap, Type sourceType, Type destType, ParameterExpression itemParam, Expression contextParam)\r\n  InnerException: \r\n```\r\n\r\n``` \r\nAutoMapper.dll!AutoMapper.Mappers.CollectionMapperExtensions.MapKeyPairValueExpr(AutoMapper.TypeMapRegistry typeMapRegistry = {AutoMapper.TypeMapRegistry}, AutoMapper.IConfigurationProvider configurationProvider = {AutoMapper.MapperConfiguration}, AutoMapper.PropertyMap propertyMap = \"Data\", System.Type sourceType = {Name = \"DataDictionary\" FullName = \"Exceptionless.Core.Models.DataDictionary\"}, System.Type destType = {Name = \"DataDictionary\" FullName = \"Exceptionless.Core.Models.DataDictionary\"}, System.Linq.Expressions.ParameterExpression itemParam = {System.Linq.Expressions.TypedParameterExpression}, System.Linq.Expressions.Expression contextParam = {System.Linq.Expressions.TypedParameterExpression})\tUnknown\r\n \tAutoMapper.dll!AutoMapper.Mappers.CollectionMapperExtensions.MapCollectionExpression(AutoMapper.TypeMapRegistry typeMapRegistry = {AutoMapper.TypeMapRegistry}, AutoMapper.IConfigurationProvider configurationProvider = {AutoMapper.MapperConfiguration}, AutoMapper.PropertyMap propertyMap = \"Data\", System.Linq.Expressions.Expression sourceExpression = {System.Linq.Expressions.FullConditionalExpression}, System.Linq.Expressions.Expression destExpression = {System.Linq.Expressions.DefaultExpression}, System.Linq.Expressions.Expression contextExpression = {System.Linq.Expressions.TypedParameterExpression}, System.Func<System.Linq.Expressions.Expression, System.Linq.Expressions.Expression> conditionalExpression = {Method = {System.Reflection.RuntimeMethodInfo}}, System.Type ifInterfaceType = {Name = \"Dictionary`2\" FullName = \"System.Collections.Generic.Dictionary`2\"}, AutoMapper.Mappers.CollectionMapperExtensions.MapItem mapItem = {Method = {System.Reflection.RuntimeMethodInfo}})\tUnknown\r\n \tAutoMapper.dll!AutoMapper.Mappers.DictionaryMapper.MapExpression(AutoMapper.TypeMapRegistry typeMapRegistry = {AutoMapper.TypeMapRegistry}, AutoMapper.IConfigurationProvider configurationProvider = {AutoMapper.MapperConfiguration}, AutoMapper.PropertyMap propertyMap = \"Data\", System.Linq.Expressions.Expression sourceExpression = {System.Linq.Expressions.FullConditionalExpression}, System.Linq.Expressions.Expression destExpression = {System.Linq.Expressions.DefaultExpression}, System.Linq.Expressions.Expression contextExpression = {System.Linq.Expressions.TypedParameterExpression})\tUnknown\r\n \tAutoMapper.dll!AutoMapper.Execution.TypeMapPlanBuilder.CreatePropertyMapFunc(AutoMapper.PropertyMap propertyMap = \"Data\", AutoMapper.IConfigurationProvider configurationProvider = {AutoMapper.MapperConfiguration}, AutoMapper.TypeMapRegistry typeMapRegistry = {AutoMapper.TypeMapRegistry}, System.Linq.Expressions.ParameterExpression srcParam = {System.Linq.Expressions.TypedParameterExpression}, System.Linq.Expressions.ParameterExpression destParam = {System.Linq.Expressions.TypedParameterExpression}, System.Linq.Expressions.ParameterExpression ctxtParam = {System.Linq.Expressions.TypedParameterExpression})\tUnknown\r\n \tAutoMapper.dll!AutoMapper.Execution.TypeMapPlanBuilder.TryPropertyMap(AutoMapper.PropertyMap pm = \"Data\", AutoMapper.IConfigurationProvider configurationProvider = {AutoMapper.MapperConfiguration}, AutoMapper.TypeMapRegistry registry = {AutoMapper.TypeMapRegistry}, System.Linq.Expressions.ParameterExpression srcParam = {System.Linq.Expressions.TypedParameterExpression}, System.Linq.Expressions.ParameterExpression destParam = {System.Linq.Expressions.TypedParameterExpression}, System.Linq.Expressions.ParameterExpression ctxtParam = {System.Linq.Expressions.TypedParameterExpression})\tUnknown\r\n \tAutoMapper.dll!AutoMapper.Execution.TypeMapPlanBuilder.CreateAssignmentFunc(AutoMapper.TypeMap typeMap = \"UserDescription\" -> \"EventUserDescription\", AutoMapper.IConfigurationProvider configurationProvider = {AutoMapper.MapperConfiguration}, AutoMapper.TypeMapRegistry registry = {AutoMapper.TypeMapRegistry}, System.Linq.Expressions.ParameterExpression srcParam = {System.Linq.Expressions.TypedParameterExpression}, System.Linq.Expressions.ParameterExpression destParam = {System.Linq.Expressions.TypedParameterExpression}, System.Linq.Expressions.ParameterExpression ctxtParam = {System.Linq.Expressions.TypedParameterExpression}, System.Linq.Expressions.Expression destinationFunc = {System.Linq.Expressions.AssignBinaryExpression}, System.Linq.Expressions.ParameterExpression destination = {System.Linq.Expressions.TypedParameterExpression}, bool constructorMapping = false)\tUnknown\r\n \tAutoMapper.dll!AutoMapper.Execution.TypeMapPlanBuilder.BuildMapperFunc(AutoMapper.TypeMap typeMap = \"UserDescription\" -> \"EventUserDescription\", AutoMapper.IConfigurationProvider configurationProvider = {AutoMapper.MapperConfiguration}, AutoMapper.TypeMapRegistry typeMapRegistry = {AutoMapper.TypeMapRegistry})\tUnknown\r\n \tAutoMapper.dll!AutoMapper.TypeMap.Seal(AutoMapper.TypeMapRegistry typeMapRegistry = {AutoMapper.TypeMapRegistry}, AutoMapper.IConfigurationProvider configurationProvider = {AutoMapper.MapperConfiguration})\tUnknown\r\n \tAutoMapper.dll!AutoMapper.MapperConfiguration.Seal(AutoMapper.IConfiguration configuration = {AutoMapper.Configuration.MapperConfigurationExpression})\tUnknown\r\n \tAutoMapper.dll!AutoMapper.MapperConfiguration.MapperConfiguration(AutoMapper.Configuration.MapperConfigurationExpression configurationExpression = {AutoMapper.Configuration.MapperConfigurationExpression}, System.Collections.Generic.IEnumerable<AutoMapper.IObjectMapper> mappers = Count = 26)\tUnknown\r\n \tAutoMapper.dll!AutoMapper.MapperConfiguration.MapperConfiguration(System.Action<AutoMapper.IMapperConfigurationExpression> configure = {Method = {System.Reflection.RuntimeMethodInfo}}, System.Collections.Generic.IEnumerable<AutoMapper.IObjectMapper> mappers = Count = 26)\tUnknown\r\n \tAutoMapper.dll!AutoMapper.MapperConfiguration.MapperConfiguration(System.Action<AutoMapper.IMapperConfigurationExpression> configure = {Method = {System.Reflection.RuntimeMethodInfo}})\tUnknown\r\n```"}}
{"actor":{"display_login":"jbogard"}}