title: EF6 model first - The entity type is not part of the model for the current context
body: <p>I know questions about this issue have already been asked dozens of times (I've read them all) but I am still left with no solution.
  Most deal with issues that can happen with code-first design, but I am doing model-first. </p>
  
  <p>I am familiar with EF, and have other working models in my solution. </p>
  
  <ul>
  <li>WPF (net 4.5) </li>
  <li>Entity Framework 6.1.3 - <strong>Model First</strong></li>
  <li>Visual Studio 2013</li>
  </ul>
  
  <p><strong>Problem</strong>:</p>
  
  <p><em>Every</em> DbSet&lt;> in my context throws the following error when being accessed:</p>
  
  <p>"An exception of type '<em>System.InvalidOperationException</em>' occurred in EntityFramework.dll but was not handled in user code</p>
  
  <p>Additional information: <strong>The entity type xxx is not part of the model for the current context</strong>.
  "</p>
  
  <p><strong>How I created the model:</strong></p>
  
  <ol>
  <li>new project</li>
  <li>add edmx - include tables model first</li>
  <li>made the entities inherit from a base class that implements INotifyPropertyChanged</li>
  <li>removed the base class and modified the .tt file so the entities implement INotifyPropertyChanged instead</li>
  <li>(Deleted everything and tried again from scratch)</li>
  </ol>
  
  <p><strong>Connection String:</strong></p>
  
  <pre><code>&lt;add name="Stratus_X_TestEntities" connectionString="metadata=res://*/PartsServiceModel.csdl|res://*/PartsServiceModel.ssdl|res://*/PartsServiceModel.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=Stratus;initial catalog=StratusX;persist security info=True;user id=user;password=password;multipleactiveresultsets=True;App=EntityFramework&amp;quot;" providerName="System.Data.EntityClient" /&gt;
  </code></pre>
  
  <p>This connection string is the same as the conenction string from a different (and working!) .edmx in my solution.</p>
  
  <p><strong>Usage:</strong></p>
  
  <pre><code>using (var ObjectContext = new TestEntities())
  {
      return ObjectContext.AccountingType.ToList();
  }
  </code></pre>
  
  <p>TestEntities is DbContext. 
  Any attempt to access ObjectContext.AccountingType, or <strong>any</strong> other DbSet&lt;> results in the error.</p>
  
  <p><strong>Things I have checked:</strong></p>
  
  <ul>
  <li>The Connection String (Model First - See above)</li>
  <li>Entities mapped correctly? yes</li>
  <li>Mulitple instances or generations of entity types - no</li>
  <li>Is the Entities inheriting from a base classes causing the error? 
  no, I removed the base class and made the .tt file generate the INotifyPropertyChanged implementation in the entities directly. Error persists!</li>
  <li>View the Model/Entity Diagram (*.edmx). Right click the offending Table, and Validate.</li>
  <li>Read every similar SO question for ideas</li>
  <li>Replicate the project in a test solution: <strong>it works in a separate solution!</strong></li>
  <li>Move the test project into working solution: same error!</li>
  </ul>
  
  <p><strong>Can anyone think of anything else to try/check??</strong></p>
  
  <p>thanks</p>