Model Compatibility cannot be Checked

Jun 9, 2011 at 2:30 AM

Hi All,

I tried to implement the MVC Music store project into a SQL server (in this case my local sql Express).

I want to simulate the situation where we already have the existing database, and built the code according to the existing database. But, I have problem even I duplicate the same MVCMusicStore database from APP_data folder into SQLEXPRESS.

The error message I get was 

Model compatibility cannot be checked because the EdmMetadata type was not included in the model. Ensure that IncludeMetadataConvention has been added to the DbModelBuilder conventions.

My Question is:

How do implement this project (MVC using Entity Framework and Code Front - correct me if I'm wrong) from the existing database?

example scenario:

a company that already have their own database but want to implement this MVC method into their new website or new module.

 

Thank you all.

Jun 9, 2011 at 4:02 AM

I case anyone have the same problem

the answer is very simple to get this to work

just insert this line on your global.asax in Application_Start method.

Database.SetInitializer<CustomContextNameHere>(null);

more information:

http://stackoverflow.com/questions/4558377/entity-framework-4-ctp-5-code-first-development

Coordinator
Jun 11, 2011 at 7:01 AM

Thanks, I appreciate your posting the answer.