title: EntityFramework Schema specified is not valid
body: <p>I know this question was already asked but it seams that my case might be slightly different. I tried the "run custom tool" but here's where the strange thing happens: Because i'm having 2 related databases (so 2 related models). If i'm running the custom tool on one model it screws up the other and vice-versa(incomplete .cs files, missing, etc.). Does anyone have any ideea where i'm going wrong? </p>
  
  <p>EDIT:</p>
  
  <p>the complete error:</p>
  
  <blockquote>
    <p>An exception of type 'System.Data.Entity.Core.MetadataException'
    occurred in EntityFramework.dll but was not handled in user code</p>
    
    <p>Additional information: Schema specified is not valid. Errors: </p>
    
    <p>The relationship
    'ProductionMasterDataEntityModel.FK_ProductGroup_CostPeriods' was not
    loaded because the type 'ProductionMasterDataEntityModel.ProductGroup'
    is not available.</p>
    
    <p>The following information may be useful in resolving the previous
    error:</p>
    
    <p>The required property 'CstAveOrderQty' does not exist on the type
    'SISCOM.Persistance.Models.ProductGroup'.</p>
  </blockquote>
  
  <p>The custom tool is: TextTemplatingFileGenerator</p>
  
  <p>I'm not sure if it has anything to do with the asp.net framework but it is an asp.net project so i thought it's worth mentioning.</p>