locked
Problem with database generate with code first RRS feed

  • Question

  • User-579780178 posted

    Hey guys, i have a empty database in a server and want generate the tables with code first, but im getting this error:

    Model compatibility cannot be checked because the database does not contain model metadata. Ensure that IncludeMetadataConvention has been added to the DbModelBuilder conventions.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.NotSupportedException: Model compatibility cannot be checked because the database does not contain model metadata. Ensure that IncludeMetadataConvention has been added to the DbModelBuilder conventions.


    I tried this:   modelBuilder.Conventions.Remove<IncludeMetadataConvention>();

    and tried this too: DropCreateDatabaseAlways

    but not worked...

    anyone know a solution to my app generate the tables in a existing database?

    thanks.

    Tuesday, December 27, 2011 8:25 AM

All replies