Entity Framework 5: DbGeography

大兔子大兔子 提交于 2019-12-11 18:44:01

问题


I'm trying to access the DbGreography datatypes in my solution. I've installed EF5 via nuget. I've referenced System.Data.Entity in which the spatial types are supposed to reside. However, There dont seem to be any system.data.spatial namespace in there.

I'm using vs.net 2012 also.

What am I missing here?


回答1:


The geography types are in System.Data.Entity assembly version 4.0.0.0. If your project was targeting a different framework when you installed EF5, you may well have got a reference to version 3.5.0.0, which doesn't have the spatial types. Make sure your project targets .NET 4.5 and that you have version 4.0.0.0 of System.Data.Entity referenced.



来源:https://stackoverflow.com/questions/13910316/entity-framework-5-dbgeography

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!