{"action":"closed","issue":{"url":"https://api.github.com/repos/aspnet/Hosting/issues/314","labels_url":"https://api.github.com/repos/aspnet/Hosting/issues/314/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Hosting/issues/314/comments","events_url":"https://api.github.com/repos/aspnet/Hosting/issues/314/events","html_url":"https://github.com/aspnet/Hosting/issues/314","id":98589435,"number":314,"title":"Guard against ReflectionTypeLoadExceptions in StartupLoader","user":{"login":"Daniel15","id":91933,"avatar_url":"https://avatars.githubusercontent.com/u/91933?v=3","gravatar_id":"","url":"https://api.github.com/users/Daniel15","html_url":"https://github.com/Daniel15","followers_url":"https://api.github.com/users/Daniel15/followers","following_url":"https://api.github.com/users/Daniel15/following{/other_user}","gists_url":"https://api.github.com/users/Daniel15/gists{/gist_id}","starred_url":"https://api.github.com/users/Daniel15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daniel15/subscriptions","organizations_url":"https://api.github.com/users/Daniel15/orgs","repos_url":"https://api.github.com/users/Daniel15/repos","events_url":"https://api.github.com/users/Daniel15/events{/privacy}","received_events_url":"https://api.github.com/users/Daniel15/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aspnet/Hosting/labels/2%20-%20Working","name":"2 - Working","color":"CCCCCC"}],"state":"closed","locked":false,"assignee":{"login":"victorhurdugaci","id":5921642,"avatar_url":"https://avatars.githubusercontent.com/u/5921642?v=3","gravatar_id":"","url":"https://api.github.com/users/victorhurdugaci","html_url":"https://github.com/victorhurdugaci","followers_url":"https://api.github.com/users/victorhurdugaci/followers","following_url":"https://api.github.com/users/victorhurdugaci/following{/other_user}","gists_url":"https://api.github.com/users/victorhurdugaci/gists{/gist_id}","starred_url":"https://api.github.com/users/victorhurdugaci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/victorhurdugaci/subscriptions","organizations_url":"https://api.github.com/users/victorhurdugaci/orgs","repos_url":"https://api.github.com/users/victorhurdugaci/repos","events_url":"https://api.github.com/users/victorhurdugaci/events{/privacy}","received_events_url":"https://api.github.com/users/victorhurdugaci/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/aspnet/Hosting/milestones/18","html_url":"https://github.com/aspnet/Hosting/milestones/1.0.0-rc2","labels_url":"https://api.github.com/repos/aspnet/Hosting/milestones/18/labels","id":1371266,"number":18,"title":"1.0.0-rc2","description":null,"creator":{"login":"muratg","id":1808428,"avatar_url":"https://avatars.githubusercontent.com/u/1808428?v=3","gravatar_id":"","url":"https://api.github.com/users/muratg","html_url":"https://github.com/muratg","followers_url":"https://api.github.com/users/muratg/followers","following_url":"https://api.github.com/users/muratg/following{/other_user}","gists_url":"https://api.github.com/users/muratg/gists{/gist_id}","starred_url":"https://api.github.com/users/muratg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muratg/subscriptions","organizations_url":"https://api.github.com/users/muratg/orgs","repos_url":"https://api.github.com/users/muratg/repos","events_url":"https://api.github.com/users/muratg/events{/privacy}","received_events_url":"https://api.github.com/users/muratg/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":1,"state":"open","created_at":"2015-10-22T21:04:09Z","updated_at":"2015-10-29T19:25:33Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-08-02T06:43:57Z","updated_at":"2015-10-29T19:25:33Z","closed_at":"2015-10-29T19:25:33Z","body":"*Original title:  Entity Framework 6 DbConfiguration causes ReflectionTypeLoadException at startup on Mono*\r\n___\r\nWow, that title is a mouthful.\r\n\r\n`DbConfiguration` is the class used for [code-based configuration in Entity Framework 6](https://msdn.microsoft.com/en-us/data/jj680699.aspx). Simply having an implementation of `DbConfiguration` in an ASP.NET 5 site causes \"ReflectionTypeLoadException: The classes in the module cannot be loaded.\" to be thrown at startup on Mono. It works fine on .NET Framework 4.5 and 4.6 though.\r\n\r\nMono version: 4.0.2\r\nCommand: `dnx --appbase /var/www/dan.cx/net5test/MonoEFTest/approot/src/MonoEFTest Microsoft.Framework.ApplicationHost kestrel`\r\nStack trace:\r\n```\r\nSystem.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.\r\n  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (System.Reflection.Assembly,bool)\r\n  at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0\r\n  at System.Reflection.Assembly+<>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0\r\n  at System.Collections.Generic.List`1[System.Reflection.TypeInfo]..ctor (IEnumerable`1 collection) [0x00000] in <filename unknown>:0\r\n  at System.Linq.Enumerable.ToList[TypeInfo] (IEnumerable`1 source) [0x00000] in <filename unknown>:0\r\n  at Microsoft.AspNet.Hosting.Startup.StartupLoader.FindStartupType (System.String startupAssemblyName, IList`1 diagnosticMessages) [0x00000] in <filename unknown>:0\r\n  at Microsoft.AspNet.Hosting.Internal.HostingEngine.EnsureStartup () [0x00000] in <filename unknown>:0\r\n  at Microsoft.AspNet.Hosting.Internal.HostingEngine.EnsureApplicationServices () [0x00000] in <filename unknown>:0\r\n  at Microsoft.AspNet.Hosting.Internal.HostingEngine.Start () [0x00000] in <filename unknown>:0\r\n  at Microsoft.AspNet.Hosting.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0\r\n  at Kestrel.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0\r\n  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)\r\n  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0\r\n  at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0\r\n  at Microsoft.Framework.ApplicationHost.Program.ExecuteMain (Microsoft.Framework.Runtime.DefaultHost host, System.String applicationName, System.String[] args) [0x00000] in <filename unknown>:0\r\n  at Microsoft.Framework.ApplicationHost.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0\r\n  at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0\r\n  at dnx.host.Bootstrapper.RunAsync (System.Collections.Generic.List`1 args, IRuntimeEnvironment env, System.Runtime.Versioning.FrameworkName targetFramework) [0x00000] in <filename unknown>:0\r\n```\r\n\r\n\r\nproject.json:\r\n```\r\n{\r\n  \"webroot\": \"wwwroot\",\r\n  \"version\": \"1.0.0-*\",\r\n\r\n  \"dependencies\": {\r\n    \"EntityFramework\": \"6.1.3\",\r\n    \"Kestrel\": \"1.0.0-beta6\",\r\n    \"Microsoft.AspNet.Server.IIS\": \"1.0.0-beta6\",\r\n    \"Microsoft.AspNet.Server.WebListener\": \"1.0.0-beta6\",\r\n    \"Microsoft.Framework.Configuration.Json\": \"1.0.0-beta6\",\r\n    \"MySql.Data.Entity\": \"6.9.7\",\r\n    \"Microsoft.AspNet.Diagnostics\": \"1.0.0-beta6\",\r\n    \"Microsoft.Framework.Logging.Console\": \"1.0.0-beta6\"\r\n  },\r\n\r\n  \"frameworks\": {\r\n    \"dnx451\": {}\r\n  }\r\n}\r\n```\r\n\r\nStartup.cs:\r\n```\r\npublic class Startup\r\n{\r\n\tpublic void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)\r\n\t{\r\n\t\tloggerFactory.MinimumLevel = LogLevel.Information;\r\n\t\tloggerFactory.AddConsole();\r\n\r\n\t\tapp.UseErrorPage();\r\n\r\n\t\tapp.Use(async (context, next) =>\r\n\t\t{\r\n\t\t\tawait context.Response.WriteAsync(\"IT WORKS YO\");\r\n\t\t});\r\n\t}\r\n}\r\n```\r\n\r\nMyDbConfiguration.cs:\r\n```\r\npublic class MyDbConfiguration : DbConfiguration\r\n{\r\n}\r\n```"}}