Installed visual studio 11 beta as wanted to test EF 5 beta but keep hitting this an error.
Method not found: 'Void System.Data.Objects.ObjectContextOptions.set_UseConsistentNullReferenceBehavior(Boolean)'.
Project is a new blank MVC3 application and below is some code that illustrate how the error happens.
public class Blog
{
public int Id { get; set; }
public string Name { get; set; }
}
public class EFDbContext : DbContext
{
public DbSet<Blog> Blogs { get; set; }
}
public class HomeController : Controller
{
protected EFDbContext Db = new EFDbContext();
public ActionResult Index()
{
Blog B = new Blog();
B.Name = "Test";
Db.Blogs.Add(B);
Db.SaveChanges();
return View();
}
}
Looked for the error on google but nothing came up and i'm not quite sure what error is referring to. I added a snippet of the stacktrace below in case it will help.
[MissingMethodException: Method not found: 'Void System.Data.Objects.ObjectContextOptions.set_UseConsistentNullReferenceBehavior(Boolean)'.] System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +0 System.Data.Entity.Internal.InternalContext.Initialize() +31
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +39
System.Data.Entity.Internal.Linq.InternalSet1.Initialize() +137
1.get_InternalContext() +38 System.Data.Entity.Internal.Linq.InternalSet
System.Data.Entity.Internal.Linq.InternalSet1.ActOnSet(Action action, EntityState newState, Object entity, String methodName) +236
1.Add(Object entity) +200 System.Data.Entity.DbSet`1.Add(TEntity entity) +72
System.Data.Entity.Internal.Linq.InternalSet