Provider未返回DbSpatialServices实例

时间:2013-07-12 08:44:23

标签: .net entity-framework

我遇到了Entity Framework的问题,并从数据库中检索数据。 我有一张桌子。此表包含具有地理类型的字段。 当我运行我的代码时:

IEnumerable<Locatie> a = locatiezoeker.Locaties.Where(x => x.siteId == geselecteerdeWebsiteId);

我收到以下错误:

  

异常:System.Data.ProviderIncompatibleException   消息:提供程序未返回DbSpatialServices实例。   来源:System.Data.Entity      在System.Data.Common.DbProviderServices.GetDbSpatialDataReader(DbDataReader fromReader,String manifestToken)      在System.Data.Common.DbProviderServices.GetSpatialDataReader(DbDataReader fromReader,String manifestToken)      在System.Data.Spatial.SpatialHelpers.CreateSpatialDataReader(MetadataWorkspace工作区,DbDataReader阅读器)      在System.Data.Common.Internal.Materialization.Shaper.b__d [TProperty](DbDataReader reader,Int32专栏)      在System.Data.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader 1.GetValue(DbDataReader reader, Int32 ordinal) at System.Data.Common.Internal.Materialization.Shaper.GetSpatialPropertyValueWithErrorHandling[TProperty](Int32 ordinal, String propertyName, String typeName, PrimitiveTypeKind spatialTypeKind) at lambda_method(Closure , Shaper ) at System.Data.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly[TEntity](Func 2 constructEntityDelegate,EntityKey entityKey,EntitySet entitySet)      在lambda_method(Closure,Shaper)      在System.Data.Common.Internal.Materialization.Coordinator 1.ReadNextElement(Shaper shaper) at System.Data.Common.Internal.Materialization.Shaper 1.SimpleEnumerator.MoveNext()      在MoreLinq.MoreEnumerable.d__17 2.MoveNext() at System.Linq.Enumerable.<SelectManyIterator>d__14 2.MoveNext()      在ImportManager.LeegDatabaseVoorGeselecteerdeWebsite(Guid geselecteerdeWebsiteId)的d:\ web \ ImportManager.cs:第461行      在VerwerkCsv()的d:\ web \ ImportTool.aspx.cs:第204行

我更新了我的edmx(事实上我重新生成了它)。我更新了我的NuGet包。我正在运行.NET 4.5。请参阅packages.config的代码段

<package id="EntityFramework" version="5.0.0" targetFramework="net45" />

有人知道这会出错吗?我无法在任何地方找到解决方案。

1 个答案:

答案 0 :(得分:0)

原来是Glimpse造成了所有麻烦: https://github.com/Glimpse/Glimpse/issues/371。 我使用了GlimpseEF5 1.2.0。在版本1.3.1中,此问题已得到修复