关于EF Codefirst使用非sqlce版本
遇到报错如下:
Model compatibility cannot be checked because the database does not contain model metadata. Ensure that IncludeMetadataConvention has been added to the DbModelBuilder conventions.
建议:
1.删除原有数据库
2.在Application_Start里面应该为以下代码
if (!Database.Exists("connString")) { Database.SetInitializer<SchoolContext>(new SchoolInitializer()); }