简体   繁体   中英

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. The entity data model is in the APP_code file. 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.

Even I had got a similar error

Error 2 Error 2019: Member Mapping specified is not valid. 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'. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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