title: MVC .NET Adding View Error DB code first
body: <p>I just made an MVC .net website and i'm getting an error while trying to make a View for Index...</p>
  
  <p>I get the error: </p>
  
  <blockquote>
    <p>"there was an error running the selected code generator: "unable to
    retrieve metadata for "MVC_Voetbal.Model.Club". The context is being
    used in Code First mode with code that was generated from an EDMX file
    for either Database First or Model First development. ......"</p>
  </blockquote>
  
  <p>I have searched alot, and found a lot of the same errors, but never saw the solution that helps me with my project..</p>
  
  <p>I get this error while trying to make a View that lists all the clubs in my database. My code:</p>
  
  <pre><code>private ClubService clubService;        
  
  public ActionResult Index()
  {
      var clubs = clubService.All();
      return View(clubs);
  }
  </code></pre>
  
  <p>Connection string in MVC_Voetbal.Model App.config:</p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="BierenEntities1" connectionString="metadata=res://*/ModelBier.csdl|res://*/ModelBier.ssdl|
          res://*/ModelBier.msl;provider=System.Data.SqlClient;provider 
          connection string=&amp;quot;data source=MSI;initial catalog=Bieren;
          integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&amp;quot;" 
          providerName="System.Data.EntityClient" /&gt;
   &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>Connection string in MVC_Voetbal  Web.config:</p>
  
  <pre><code>&lt;add name="BierenEntities1" connectionString="Data 
      Source=PC_DENZEL\SQLVIVES;
      Initial Catalog=VoetbalDB;
      Integrated Security=True" 
      providerName="System.Data.EntityClient" /&gt;
  </code></pre>