Shapefile Provider throws error - InvalidOperationException

Nov 17, 2014 at 3:48 PM
Edited Nov 17, 2014 at 5:44 PM
I am using some older code that I used from the .9 version and am now using the nuget version from today.
using SharpMap.Data.Providers;
....
private void recurseShapefile(string filename)
{
  ShapeFile shape = new ShapeFile("parts.shp"); //ERRORS HERE
  shape.Open();
.....
}
I keep getting the error
InvalidOperationException was unhandled
Cannot use GeometryServiceProvider without an assigned IGeometryServices class

I tried to assign to a vectorlayer datasource got the same errror.

I just noticed in the output the following line:

"A first chance exception of type 'System.InvalidOperationException' occurred in GeoAPI.dll"

What am I doing wrong.

Carlos Ortiz
Nov 17, 2014 at 6:40 PM
found the answer in this thread.

https://sharpmap.codeplex.com/discussions/399879
Nov 19, 2014 at 10:24 AM
thankyou