TypeInitializationException occured in 'System.Data.Entity.dll' - type initializer 'ExtentPlaceholderCreator'
<p>Running Visual Studio 2013 
ASP.NET MVC 4 
Entity Framework (EF) 5</p>

<p>After running my project, when navigating to the 'create' page. I try to post information to local mysql database, this exception is thrown...</p>

<blockquote>
  <p>An exception of type 'System.TypeInitializationException' occurred in
  System.Data.Entity.dll but was not handled in user code</p>
  
  <p>Additional information: The type initializer for
  'ExtentPlaceholderCreator' threw an exception.</p>
</blockquote>

<p>at this location in my AuctionController.cs file</p>

<pre><code>[HttpPost]
public ActionResult Create([Bind(Exclude="CurrentPrice")]Models.Auction auction)
{
    if (ModelState.IsValid)
    {
        // Save to the database
        var db = new MvcAuction.Models.AuctionsDataContext();
        db.Auctions.Add(auction);

        db.SaveChanges();

        return RedirectToAction("Index");
    }

    return Create();
}
</code></pre>

<p><a href="https://i.stack.imgur.com/jV1cc.png" rel="nofollow">Click here to see screenshot of error</a></p>

<p>This is my Database Context class file:</p>

<pre><code> namespace MvcAuction.Models
{
    public class AuctionsDataContext : System.Data.Entity.DbContext
    {
        public System.Data.Entity.DbSet&lt;Auction&gt; Auctions { get; set; }
    }
}
</code></pre>

<p>I think the issue is going wrong in my web.config file:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;configuration&gt;
  &lt;configSections&gt;
    &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;
  &lt;/configSections&gt;
  &lt;connectionStrings&gt;
    &lt;add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-MvcAuction-20121126103244;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-MvcAuction-20121126103244.mdf" providerName="System.Data.SqlClient" /&gt;
    &lt;add name="MvcAuction.Models.AuctionsDatacontext" connectionString="Data Source=(LocalDb)\v11.0;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\MvcAuction.Models.AuctionsDatacontext.mdf" providerName="System.Data.SqlClient" /&gt;
  &lt;/connectionStrings&gt;
</code></pre>

<p>I am following this tutorial: <a href="https://www.lynda.com/ASP-NET-tutorials/Persisting-data-Entity-Framework-code-first/109762/120303-4.html?autoplay=true" rel="nofollow">https://www.lynda.com/ASP-NET-tutorials/Persisting-data-Entity-Framework-code-first/109762/120303-4.html?autoplay=true</a></p>

<p>The teacher is using Visual Studio 2012, his works fine:D </p>

<p>I do not know why this is holding me up. Nor what exactly it is asking, to my knowledge there were no breaking changes from Visual Studio 2012 to 2013.</p>