Entity Framwork:Value cannot be null. Parameter name: key <p>In my project I use Entity Framework with MySQL. this code:</p> <pre><code>objectContext.users.Include("posts").Take(2).ToList() </code></pre> <p>throws an exception: <code>System.ArgumentNullException: Value cannot be null. Parameter name: key</code></p> <p>with such stack trace:</p> <pre><code>[ArgumentNullException: Value cannot be null. Parameter name: key] System.Collections.Generic.Dictionary`2.FindEntry(TKey key) +12670485 MySql.Data.Entity.Scope.GetFragment(String name) +27 MySql.Data.Entity.SelectStatement.AddDefaultColumns(Scope scope) +177 MySql.Data.Entity.SelectStatement.Wrap(Scope scope) +90 MySql.Data.Entity.SelectGenerator.WrapJoinInputIfNecessary(InputFragment fragment, Boolean isRightPart) +251 MySql.Data.Entity.SelectGenerator.HandleJoinExpression(DbExpressionBinding left, DbExpressionBinding right, DbExpressionKind joinType, DbExpression joinCondition) +110 MySql.Data.Entity.SelectGenerator.Visit(DbJoinExpression expression) +33 MySql.Data.Entity.SqlGenerator.VisitInputExpression(DbExpression e, String name, TypeUsage type) +50 MySql.Data.Entity.SelectGenerator.VisitInputExpressionEnsureSelect(DbExpression e, String name, TypeUsage type) +19 MySql.Data.Entity.SelectGenerator.Visit(DbProjectExpression expression) +45 MySql.Data.Entity.SqlGenerator.VisitInputExpression(DbExpression e, String name, TypeUsage type) +50 MySql.Data.Entity.SelectGenerator.VisitInputExpressionEnsureSelect(DbExpression e, String name, TypeUsage type) +19 MySql.Data.Entity.SelectGenerator.Visit(DbSortExpression expression) +61 MySql.Data.Entity.SqlGenerator.VisitInputExpression(DbExpression e, String name, TypeUsage type) +50 MySql.Data.Entity.SelectGenerator.VisitInputExpressionEnsureSelect(DbExpression e, String name, TypeUsage type) +19 MySql.Data.Entity.SelectGenerator.Visit(DbProjectExpression expression) +45 MySql.Data.Entity.SelectGenerator.GenerateSQL(DbCommandTree tree) +73 MySql.Data.MySqlClient.MySqlProviderServices.CreateDbCommandDefinition(DbProviderManifest providerManifest, DbCommandTree commandTree) +401 System.Data.EntityClient.EntityCommandDefinition..ctor(DbProviderFactory storeProviderFactory, DbCommandTree commandTree) +608 </code></pre> <p>It is interesting that <code>objectContext.users.Take(2).ToList()</code> or <code>objectContext.users.Include("posts").ToList()</code> works fine.</p> <p>Anyone encountered this problem?</p>