Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7629209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:46:39+00:00 2026-05-31T05:46:39+00:00

Installed visual studio 11 beta as wanted to test EF 5 beta but keep

  • 0

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
System.Data.Entity.Internal.Linq.InternalSet
1.get_InternalContext()
+38 System.Data.Entity.Internal.Linq.InternalSet1.ActOnSet(Action action, EntityState newState, Object entity, String methodName) +236
System.Data.Entity.Internal.Linq.InternalSet
1.Add(Object entity) +200
System.Data.Entity.DbSet`1.Add(TEntity entity) +72

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:46:41+00:00Added an answer on May 31, 2026 at 5:46 am

    Looks like you are using the EF5 EntityFramework.dll but then running with .NET 4 installed instead of .NET 4.5.

    If you are intending to target .NET 4.5, then make sure that .NET 4.5 is installed on the machine on which you are running the code. VS11 installs .NET 4.5 for you, but you can also install just the runtime on a non-dev machine.

    If you are intending to target .NET 4, then make sure that you project is set to target .NET 4 and then uninstall and reinstall the EF5 NuGet package. You must uninstall and reinstall because NuGet won’t change the assembly in use automatically when the project is re-taregted.

    Update:

    You may also see this exception if you still have the EF June CTP installed or if it failed to uninstall correctly. Please try to uninstall the June CTP fully before installing VS11. If you still see problems them open a “Developer Command Prompt” as Administrator and run:

    gacutil /u System.Data.Entity,Version=4.2.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089
    

    If this still fails, then you can attempt to force the uninstall from the GAC with:

    gacutil /uf System.Data.Entity,Version=4.2.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I installed the beta 2 of Visual Studio 2010 today. I went to test
I have Visual Studio 2010 beta 2 installed and Expression Blend Preview for .NET
Consider a fresh install of Visual Studio 2010 Beta 2. In this case, the
I installed Visual Studio (Web Developer in this case) Express Edition and was reading
Installed Visual Studio Web Developer 2010 Express from the ISO available from this page:
I just installed Visual Studio 2010 Beta 2 on my hard drive. I also
I recently installed Visual Studio Professional 2010 Beta 1 and noticed that most of
Since I installed it on my Visual Studio 2010 beta 2 I couldn't make
I've just downloaded and installed Visual Studio 11 Beta. I looks great and I
I installed the Visual Studio 11 Beta and suddenly all the async action methods

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.