简体   繁体   English

实体框架崩溃

[英]Entity framework falling over

When I publish my website and put it on the live server the site falls over with the error below. 当我发布我的网站并将其放置在实时服务器上时,该网站将发生以下错误。 The code works fine localy in visual studio and I have checked my server has connectivity to the database. 该代码在Visual Studio中的本地环境下运行良好,并且我已检查我的服务器与数据库的连接。 The entity data model is in the APP_code file. 实体数据模型位于APP_code文件中。 Possibly that is wrong? 可能那是错的吗? Thanks 谢谢

Schema specified is not valid. Errors: 
App_Code.portal.msl(26,12) : error 2019: Member Mapping specified is not valid. The type 'Edm.DateTimeOffset[Nullable=False,DefaultValue=,Precision=]' of member 'updated' in type 'fldtportalModel.accounting_traffic' is not compatible with 'MySql.timestamp[Nullable=False,DefaultValue=,Precision=0]' of member 'updated' in type 'fldtportalModel.Store.accounting_traffic'.

EDIT Just to clarify im using exactly the same databse on live and on my local. 编辑只是为了澄清即时消息使用实时和本地上完全相同的数据库。

Did you read the exception message? 您是否阅读了异常消息?

Your DateTimeOffset field in the model is not compatible with the timestamp field in the database. 模型中的DateTimeOffset字段与数据库中的timestamp字段不兼容。

Even I had got a similar error 即使我也有类似的错误

Error 2 Error 2019: Member Mapping specified is not valid. 错误2错误2019:指定的成员映射无效。 The type 'Edm.Int32[Nullable=False,DefaultValue=]' of member 'AllowedProjects' in type 'VanillaBugsDbModel.CompanyProfile' is not compatible with 'MySql.smallint[Nullable=False,DefaultValue=]' of member 'allowedProjects' in type 'VanillaBugsDbModel.Store.companyprofile'. 类型“ VanillaBugsDbModel.CompanyProfile”中成员“ AllowedProjects”的类型“ Edm.Int32 [Nullable = False,DefaultValue =]”与成员“ allowedProjects”中成员“ MySql.smallint [Nullable = False,DefaultValue =]”不兼容键入“ VanillaBugsDbModel.Store.companyprofile”。 C:\\Yasser\\projects\\Vanilla Bugs\\trunk\\src\\VanillaBugs.Service\\Data\\MySql\\VanillaBugs.edmx 515 17 VanillaBugs.Service C:\\ Yasser \\ projects \\ Vanilla Bugs \\ trunk \\ src \\ VanillaBugs.Service \\ Data \\ MySql \\ VanillaBugs.edmx 515 17 VanillaBugs.Service

Thanks to this comment on the marked answer I was able to get this fixed. 感谢对标记答案的评论 ,我得以解决此问题。

It was probably because the schema or MySQL DLL version is different. 可能是因为架构或MySQL DLL版本不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM