天天看點

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