title: EF 4.1 Code First and Existing Database and .NET Membership
body: <p>I have a database called ApplicationName_Development running on SQL Server 2008 R2 Developer edition on my development box.</p>
  
  <p>I added .NET membership tables to the database with no problem. When I tried to get Code First working I received the following error message:</p>
  
  <blockquote>
    <p>The server encountered an error
    processing the request. The exception
    message is "Model compatibility cannot
    be checked because the database does
    not contain model metadata. Ensure
    that IncludeMetadataConvention has
    been added to the DbModelBuilder
    conventions.</p>
  </blockquote>
  
  <p>After some googling, I discovered that I had to delete the database and let EF create the database. That's fine but I lost all my .NET membership tables. I can go back in and add the membership tables again but if my model changes and EF needs to recreate the database then I have to add the membership tables in again.</p>
  
  <p>How do I get around this?</p>