mvc3官方有一个音乐商店模型。我做到用simpledata.cs做seed,读取里面的数据的时候,我都是按照里面的步骤一步一步做的,为什么运行的时候报错:EF,config中的配置是:
<connectionStrings>
<add name="MovieDBContext"
connectionString="Data Source=|DataDirectory|MvcMusicStore.sdf"
providerName="System.Data.SqlServerCe.4.0"/>
</connectionStrings>
报错语句是var genres = storeDB.Genres.ToList();错误是:
Model compatibility cannot be checked because the database does not contain model metadata. Ensure that IncludeMetadataConvention has been added to the DbModelBuilder conventions.
<connectionStrings>
<add name="MovieDBContext"
connectionString="Data Source=|DataDirectory|MvcMusicStore.sdf"
providerName="System.Data.SqlServerCe.4.0"/>
</connectionStrings>
报错语句是var genres = storeDB.Genres.ToList();错误是:
Model compatibility cannot be checked because the database does not contain model metadata. Ensure that IncludeMetadataConvention has been added to the DbModelBuilder conventions.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货