EntityCommandExecutionException with EF5

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
Posts: 6
Joined: Wed 20 Apr 2016 06:56

EntityCommandExecutionException with EF5

Post by tco95ttocs » Tue 07 May 2019 06:18

Hi guys,

i got a problem selecting some data from my postgres-DB

When i do i got an exception:
NetTopologySuite spatial service provider value checking failed. Unexpected provider value type 'Microsoft.SqlServer.Types.SqlGeometry'.
first of all i try to create a point-geometry:

Code: Select all

var bm_dop = DbGeometry.FromText("Point(" + x_coord_bm_dop + " " + y_coord_bm_dop + ")", 25832);
this all works fine. Now i try to get some data from another table using the point-geometry with the distance-method

Code: Select all

var bildvorhanden = db.bild.Where(x => x.bildflug_id == bildflug && x.ausgefloeht == false).OrderBy(x => x.bildmitte.Distance(bm_dop)).First();
Here i got the above error! Why?

i use the folowing things:

EF 5
dotconnect 7.13.1366.0
Postgis 1.5.8
Postgres 9.1.5
Nettopologysuite 1.13.2

in my App.config i have the following entrys:

Code: Select all

    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="Devart.Data.PostgreSql.Entity" type="Devart.Data.PostgreSql.Entity.Configuration.PgSqlEntityProviderConfigurationSection, Devart.Data.PostgreSql.Entity.EF5, Version=7.13.1366.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
      <remove invariant="Devart.Data.PostgreSql" />
      <add name="dotConnect for PostgreSQL" invariant="Devart.Data.PostgreSql" description="Devart dotConnect for PostgreSQL" type="Devart.Data.PostgreSql.PgSqlProviderFactory, Devart.Data.PostgreSql, Version=7.13.1366.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
  <Devart.Data.PostgreSql.Entity xmlns="http://devart.com/schemas/Devart.Data.PostgreSql.Entity/1.0">
    <SpatialOptions SpatialServiceType="NetTopologySuite" />
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <assemblyIdentity name="NetTopologySuite" publicKeyToken="f580a05016ebada1" culture="neutral" />
        <bindingRedirect oldVersion="" newVersion="" />
So what could be wrong?

Thx for helping

Site Admin
Posts: 8743
Joined: Thu 14 Aug 2008 12:44

Re: EntityCommandExecutionException with EF5

Post by Shalex » Mon 13 May 2019 10:34

Please upload a small test project with the corresponding DDL/DML script for reproducing the error to some file exchange server to some file exchange server (e.g.: www.dropbox.com) and send us the download link.

Post Reply