[Solved] Spatials doesn't support GeoApi 1.7.4?

[Solved] Spatials doesn't support GeoApi 1.7.4?

Postby Ossi » Fri 03 Mar 2017 11:59

DEAR PEOPLE FROM THE FUTURE
The solution was found from this post: http://forums.devart.com/viewtopic.php?f=3&t=32129

Re: Cannot initialize SpatialServiceType
Postby Feneck91 » Tue 03 Jan 2017 13:16

<snip>
SpatialServiceType.NetTopologySuite is now obsolete.
Need to use SpatialServiceType.NetTopologySuiteSigned


In your web or app config, or if you are doing your configs in code: change NetTopologySuite to NetTopologySuiteSigned.

Example:
Code: Select all
  <!-- INSIDE CONFIG SECTIONS -->
<Devart.Data.PostgreSql.Entity xmlns="http://devart.com/schemas/Devart.Data.PostgreSql.Entity/1.0">
    <SpatialOptions SpatialServiceType="NetTopologySuiteSigned" />
    <QueryOptions CaseInsensitiveLike="true" NoEscapeLike="true" />
    <CodeFirstOptions TruncateLongDefaultNames="true" />
  </Devart.Data.PostgreSql.Entity>


Original message:
Hi,

I noticed the following lines from the release notes:
NetTopologySuite 1.14 is supported in EF5/EF6
GeoAPI 1.7.4 is supported in EF5/EF6


I updated our dotConnect and nuget packages for GeoAPI & NTS, and now our projects throws exception.

{"Could not load file or assembly 'GeoAPI, Version=1.7.2.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"GeoAPI, Version=1.7.2.0, Culture=neutral, PublicKeyToken=null"}


Source: Devart.Data.PostgreSql.Entity.Spatials.EF6
StackTrace:
at Devart.Common.Entity.EntityNetTopologySuiteSpatialServices.GeometryFromText(String wellKnownText)
at System.Data.Entity.Spatial.DbGeometry.FromText(String wellKnownText)
at System.Data.Entity.Migrations.Model.ColumnModel.CreateDefaultValue()
at System.Data.Entity.Migrations.Model.ColumnModel..ctor(PrimitiveTypeKind type, TypeUsage typeUsage)
at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.BuildColumnModel(EdmProperty property, TypeUsage conceptualTypeUsage, TypeUsage defaultStoreTypeUsage, IDictionary`2 annotations)
at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.BuildColumnModel(EdmProperty property, ModelMetadata modelMetadata, IDictionary`2 annotations)
at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.<>c__DisplayClass2e3.<BuildCreateTableOperation>b__2df(EdmProperty p)
at System.Data.Entity.Utilities.IEnumerableExtensions.Each[T](IEnumerable`1 ts, Action`1 action)
at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.BuildCreateTableOperation(EntitySet entitySet, ModelMetadata modelMetadata)
at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.<FindAddedTables>b__194(EntitySet es)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.Diff(ModelMetadata source, ModelMetadata target, Lazy`1 modificationCommandTreeGenerator, MigrationSqlGenerator migrationSqlGenerator, String sourceModelVersion, String targetModelVersion)
at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.Diff(XDocument sourceModel, XDocument targetModel, Lazy`1 modificationCommandTreeGenerator, MigrationSqlGenerator migrationSqlGenerator, String sourceModelVersion, String targetModelVersion)
at System.Data.Entity.Migrations.DbMigrator.IsModelOutOfDate(XDocument model, DbMigration lastMigration)
at System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerable`1 pendingMigrations, String targetMigrationId, String lastMigrationId)
at System.Data.Entity.Migrations.DbMigrator.UpdateInternal(String targetMigration)
at System.Data.Entity.Migrations.DbMigrator.<>c__DisplayClassc.<Update>b__b()
at System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase)
at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration)
at System.Data.Entity.Migrations.Infrastructure.MigratorBase.Update()
at ConsoleApplication2.Program.Main(String[] args) in C:\Users\oka\documents\visual studio 2015\Projects\ConsoleApplication2\ConsoleApplication2\Program.cs:line 12
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()


FusionLog:
=== Pre-bind state information ===
LOG: DisplayName = GeoAPI, Version=1.7.2.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Users/<snip>/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : Devart.Data.PostgreSql.Entity.Spatials.EF6, Version=7.7.852.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\<snip>\bin\Debug\ConsoleApplication2.vshost.exe.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/<snip>/bin/Debug/GeoAPI.DLL.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.


I also created a minimalistic project to show this exception for this too.
Last edited by Ossi on Mon 06 Mar 2017 11:42, edited 1 time in total.
Ossi
 
Posts: 3
Joined: Tue 15 Nov 2016 11:53

Re: Spatials doesn't support GeoApi 1.7.4?

Postby Ossi » Fri 03 Mar 2017 12:24

Also when using GeoApi version 1.7.2 it throws this exception:

FileLoadException: Could not load file or assembly 'System.Net.Http.Primitives, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
at System.Reflection.RuntimeAssembly.GetExportedTypes()
at GeoAPI.GeometryServiceProvider.GetLoadableTypes(Assembly assembly)
at GeoAPI.GeometryServiceProvider.ReflectInstance()
at GeoAPI.GeometryServiceProvider.get_Instance()
at Devart.Common.Entity.EntityNetTopologySuiteSpatialServices.d()
at Devart.Common.Entity.EntityNetTopologySuiteSpatialServices.b(String A_0, Int32 A_1)
at Devart.Common.Entity.EntityNetTopologySuiteSpatialServices.GeometryFromText(String wellKnownText)
at System.Data.Entity.Core.Mapping.Update.Internal.Propagator.ExtentPlaceholderCreator.InitializeSpatialTypeDefaultMap()
at System.Lazy`1.CreateValue()
Ossi
 
Posts: 3
Joined: Tue 15 Nov 2016 11:53

Re: [Solved] Spatials doesn't support GeoApi 1.7.4?

Postby Shalex » Mon 06 Mar 2017 14:42

Thank you for confirming solution.
Shalex
Devart Team
 
Posts: 7774
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for PostgreSQL