NetTopologySuite / NetTopologySuite.IO.GeoJSON

GeoJSON IO module for NTS.
BSD 3-Clause "New" or "Revised" License
111 stars 46 forks source link

System.TypeLoadException: Could not load type 'NetTopologySuite.CoordinateSystems.ICRSObject' #40

Closed ranouf closed 5 years ago

ranouf commented 5 years ago

Hi

Following @airbreather 's suggestions in https://github.com/NetTopologySuite/NetTopologySuite.IO.GeoJSON/issues/38, I m using Ef Core 2.2.6 so I use NetTopologySuite 1.15.3 as suggested, I m able to migrate the DataBase with GeoometryPoint 👍

From what I understand, if I want to deserialize the json containing Spatial data, I need to use NetTopologySuite.IO.GeoJSON. I looked in the dependencies, the last available version of NetTopologySuite.IO.GeoJSON using NetTopologySuite (without .Core) is 1.14.0.

In my code, I do:

using (var geoBaseReader = new JsonTextReader(File.OpenText(GeoBaseFilename)))
{
   var officialGeoBase = new GeoJsonSerializer().Deserialize<GeoBaseClass>(geoBaseReader);
}

When I launch the execution, I have this error:

System.TypeLoadException: Could not load type 'NetTopologySuite.CoordinateSystems.ICRSObject'

What did I misconfigure?

airbreather commented 5 years ago

From what I understand, if I want to deserialize the json containing Spatial data, I need to use NetTopologySuite.IO.GeoJSON. I looked in the dependencies, the last available version of NetTopologySuite.IO.GeoJSON using NetTopologySuite (without .Core) is 1.14.0.

NetTopologySuite.Core is fine in 1.x; this package was renamed to NetTopologySuite, but only for 2.x. You can still reference NetTopologySuite v1.15.3 without breaking NetTopologySuite.IO.GeoJSON.

Try version 1.15.5 of the NetTopologySuite.IO.GeoJSON package.

ranouf commented 5 years ago

Thanks it helps!