DbContext failed with PrimitiveType! = Null error

Using the Entity Framework Code First, the web application crashes when DbContext is called with the following error:

Approval Failed

Expression: primitiveType! = Null

Description: Assertion failed: primitiveType! = Null

Failure in the following line of code:

public class MyDb : DbContext {

which is called:

MyDb _db = new MyDb();

So, this is like calling a DbContext, causing a fatal error. DbContext is an EF function and I cannot debug inside EntityFramework.dll

+5
source share
4 answers

, EntityFramework. Visual Studio . , ModelHash, , ( EdmMetaData). , EdmMetaData DbDatabase.SetInitializer<MyContext>( new DropCreateDatabaseIfModelChanges<MyContext>());, : EntityFramework, EdmMetaData ModelHash.

+1

asp.net4.5 . - Entity Framework .

"EdmMetaData" .

+1

I cast linq to sql and get this error. I don’t know what entities do this.

0
source

You need to upgrade EntityFramework version

-1
source

All Articles