Model compatibility cannot be checked because the database does not contain model metadata
生活随笔
收集整理的這篇文章主要介紹了
Model compatibility cannot be checked because the database does not contain model metadata
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
使用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.
解決方法:
USE [master] GO/****** Object: Database [DBname] ******/ALTER DATABASE [DBname] SET SINGLE_USER WITH ROLLBACK IMMEDIATEALTER DATABASE [DBname] SET SINGLE_USER WITH NO_WAITDROP DATABASE [DBname]GODBname 即為你的數據庫名稱,執行完上面的這段Sql語句,上面出現的問題就解決了。
轉載于:https://www.cnblogs.com/joyceTING/p/3549079.html
超強干貨來襲 云風專訪:近40年碼齡,通宵達旦的技術人生總結
以上是生活随笔為你收集整理的Model compatibility cannot be checked because the database does not contain model metadata的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 设计模式:策略模式(Strategy)
- 下一篇: HDU题解索引