{"action":"created","issue":{"url":"https://api.github.com/repos/mikeedwards83/Glass.Mapper/issues/224","repository_url":"https://api.github.com/repos/mikeedwards83/Glass.Mapper","labels_url":"https://api.github.com/repos/mikeedwards83/Glass.Mapper/issues/224/labels{/name}","comments_url":"https://api.github.com/repos/mikeedwards83/Glass.Mapper/issues/224/comments","events_url":"https://api.github.com/repos/mikeedwards83/Glass.Mapper/issues/224/events","html_url":"https://github.com/mikeedwards83/Glass.Mapper/issues/224","id":155645796,"number":224,"title":"Invalid type owner for DynamicMethod when using AttributeConfigurationLoader","user":{"login":"chenhendrawan","id":2030954,"avatar_url":"https://avatars.githubusercontent.com/u/2030954?v=3","gravatar_id":"","url":"https://api.github.com/users/chenhendrawan","html_url":"https://github.com/chenhendrawan","followers_url":"https://api.github.com/users/chenhendrawan/followers","following_url":"https://api.github.com/users/chenhendrawan/following{/other_user}","gists_url":"https://api.github.com/users/chenhendrawan/gists{/gist_id}","starred_url":"https://api.github.com/users/chenhendrawan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenhendrawan/subscriptions","organizations_url":"https://api.github.com/users/chenhendrawan/orgs","repos_url":"https://api.github.com/users/chenhendrawan/repos","events_url":"https://api.github.com/users/chenhendrawan/events{/privacy}","received_events_url":"https://api.github.com/users/chenhendrawan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-05-19T03:12:05Z","updated_at":"2016-06-26T19:09:04Z","closed_at":null,"body":"I'm using Glass.Mapper version 3.0.10.23 and Glass.Mapper.Sc version 3.2.0.39. (I know its rather old, but we can't update right now) and Sitecore 7.0. I'm using attribute based configuration. Everything was working fine until I changed this line from the GlassMapperScCustom.cs file\r\n```\r\npublic static IConfigurationLoader[] GlassLoaders()\r\n        {\r\n\r\n            /* USE THIS AREA TO ADD FLUENT CONFIGURATION LOADERS\r\n             * \r\n             * If you are using Attribute Configuration or automapping/on-demand mapping you don't need to do anything!\r\n             * \r\n             */\r\n            return new IConfigurationLoader[] { };\r\n        }\r\n```\r\nto become\r\n```\r\nreturn new IConfigurationLoader[] { new Glass.Mapper.Configuration.Attributes.AttributeConfigurationLoader(\"MyAssembly.Name.Here\") };\r\n```\r\nBasically I just want to force Glass.Mapper to load all the classes during startup.\r\n\r\nBut then I got this strange error in the site.\r\n```\r\nInvalid type owner for DynamicMethod when using AttributeConfigurationLoader\r\nArgumentException: Invalid type owner for DynamicMethod.]\r\n   System.Reflection.Emit.DynamicMethod.Init(String name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] signature, Type owner, Module m, Boolean skipVisibility, Boolean transparentMethod, StackCrawlMark& stackMark) +14386452\r\n   System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes, Type owner) +140\r\n   Glass.Mapper.Utilities.CreateConstructorDelegates(Type type) +827\r\n   Glass.Mapper.Configuration.Attributes.AbstractTypeAttribute.Configure(Type type, AbstractTypeConfiguration config) +85\r\n   Glass.Mapper.Sc.Configuration.Attributes.SitecoreTypeAttribute.Configure(Type type) +1044\r\n   Glass.Mapper.Configuration.Attributes.AttributeTypeLoader.LoadType(Type type) +343\r\n   Glass.Mapper.Configuration.Attributes.AttributeTypeLoader.Load() +100\r\n   Glass.Mapper.Configuration.Attributes.AttributeConfigurationLoader.LoadFromAssembly(Assembly assembly) +391\r\n   Glass.Mapper.Configuration.Attributes.AttributeConfigurationLoader.<Load>b__0(String assemblyName) +94\r\n   System.Linq.WhereSelectArrayIterator`2.MoveNext() +82\r\n   System.Linq.Enumerable.Aggregate(IEnumerable`1 source, Func`3 func) +123\r\n   Glass.Mapper.Configuration.Attributes.AttributeConfigurationLoader.Load() +273\r\n```\r\n\r\nIs this a known issue that has been fixed in newer updates? Or am I missing something?"},"comment":{"url":"https://api.github.com/repos/mikeedwards83/Glass.Mapper/issues/comments/228617024","html_url":"https://github.com/mikeedwards83/Glass.Mapper/issues/224#issuecomment-228617024","issue_url":"https://api.github.com/repos/mikeedwards83/Glass.Mapper/issues/224","id":228617024,"user":{"login":"mikeedwards83","id":123856,"avatar_url":"https://avatars.githubusercontent.com/u/123856?v=3","gravatar_id":"","url":"https://api.github.com/users/mikeedwards83","html_url":"https://github.com/mikeedwards83","followers_url":"https://api.github.com/users/mikeedwards83/followers","following_url":"https://api.github.com/users/mikeedwards83/following{/other_user}","gists_url":"https://api.github.com/users/mikeedwards83/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeedwards83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeedwards83/subscriptions","organizations_url":"https://api.github.com/users/mikeedwards83/orgs","repos_url":"https://api.github.com/users/mikeedwards83/repos","events_url":"https://api.github.com/users/mikeedwards83/events{/privacy}","received_events_url":"https://api.github.com/users/mikeedwards83/received_events","type":"User","site_admin":false},"created_at":"2016-06-26T19:09:04Z","updated_at":"2016-06-26T19:09:04Z","body":"Hi \r\nWe haven't seen this error before but can you check to see if you have interfaces with Methods defined?\r\n\r\nSee http://stackoverflow.com/questions/10698915/invalid-type-owner-for-dynamicmethod-error-when-sorting-an-interface\r\n\r\nMike"}}
{"actor":{"display_login":"mikeedwards83"}}