EF:无法检查模型兼容性,因为数据库不包含模型元数据。

Model compatibility cannot be checked because the database does not contain model metadata. Model compatibility can only be checked for databases created using Code First or Code First Migrations.

无法检查模型兼容性,因为数据库不包含模型元数据。模型兼容性只能检查使用代码第一或代码第一迁移所创建的数据库。

解决办法:

在Visual Studio中打开“程序管理控制台”

PM> Enable-Migrations

PM> Update-Database -Force
原文地址:https://www.cnblogs.com/taony/p/5754834.html