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
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
使用EF的時(shí)候映射數(shù)據(jù)的時(shí)候,出現(xiàn)了下面的問題。如圖:
錯(cuò)誤的提示為: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 即為你的數(shù)據(jù)庫名稱,執(zhí)行完上面的這段Sql語句,上面出現(xiàn)的問題就解決了。
轉(zhuǎn)載于:https://www.cnblogs.com/joyceTING/p/3549079.html
超強(qiáng)干貨來襲 云風(fēng)專訪:近40年碼齡,通宵達(dá)旦的技術(shù)人生總結(jié)
以上是生活随笔為你收集整理的Model compatibility cannot be checked because the database does not contain model metadata的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 设计模式:策略模式(Strategy)
- 下一篇: HDU题解索引