Asp.net MVC3错误总结

来源:互联网 发布:python 字典value求和 编辑:程序博客网 时间:2024/05/29 11:11

1.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.

碰到此错误是由于使用了Code First来生成数据库,生成数据库之后修改了模型。只需要在Global.asax.cs的Application_Start()方法中将Database.SetInitializer<xxxDbContext>(new DatabaseInitializer());改为Database.SetInitializer<xxxDbContext>(null);即可。

原创粉丝点击