问题
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