Recently I tried setting the GeometryValidationMode on a shapefile to SqlGeometry. When I run the application from the IDE or anywhere else on my developer machine, there is no problem. But when I deploy to my test user machine an exception is generated on this line of code:
Dim oFeatures = moPointsLayer.QueryTools.GetFeaturesIntersecting(moSelectPolygon, ReturningColumnsType.NoColumns)
For my testing I simply copied the entire Release or Debug folder to the machine. All dependencies that should be on the target machine are there, and this exception always happens:
Exception Source: ThinkGeo.MapSuite
Exception Type: System.InvalidOperationException
Exception Message: Looks up a localized string similar to To use this method, you have to reference Microsoft.SqlServer.Types.dll, and copy folder[Install-Path]\Developer Reference\[Product]\SqlServerTypes_X64(SqlServerTypes_X86) to System32\Map Suite *.* folder for x86/x64 platform.
Exception Target Site: MakeValid
---- Stack Trace ----
rSY=.tCY=.MakeValid(feature As Feature)
GeoSuite.exe: N 00265
System.Linq.WhereSelectEnumerableIterator`2.MoveNext()
GeoSuite.exe: N 00235
System.Collections.Generic.List`1..ctor(collection As IEnumerable`1)
GeoSuite.exe: N 00453
System.Linq.Enumerable.ToList(source As IEnumerable`1)
GeoSuite.exe: N 00073
ThinkGeo.MapSuite.Layers.FeatureSource.6Cc=(features As Collection`1)
GeoSuite.exe: N 00138
ThinkGeo.MapSuite.Layers.FeatureSource.SpatialQuery(targetShape As BaseShape, queryType As QueryType, returningColumnNames As IEnumerable`1)
GeoSuite.exe: N 01373
MapUtilities.frmGridAnalysis.mGenerateGrid(eGeographyUnit As GeographyUnit)
frmGridAnalysis.vb: line 0349, col 05, IL 0634
MapUtilities.frmGridAnalysis.btnCreateGrid_Click(sender As Object, e As EventArgs)
frmGridAnalysis.vb: line 0476, col 05, IL 0174
System.Windows.Forms.Control.OnClick(e As EventArgs)
GeoSuite.exe: N 00135
Infragistics.Win.Misc.UltraButtonBase.OnClick(e As EventArgs)
GeoSuite.exe: N 00137
Infragistics.Win.Misc.UltraButton.OnMouseUp(e As MouseEventArgs)
GeoSuite.exe: N 00205
System.Windows.Forms.Control.WmMouseUp(m As Message&, button As MouseButtons, clicks As Int32)
GeoSuite.exe: N 00733
System.Windows.Forms.Control.WndProc(m As Message&)
GeoSuite.exe: N 02428
System.Windows.Forms.NativeWindow.Callback(hWnd As IntPtr, msg As Int32, wparam As IntPtr, lparam As IntPtr)
GeoSuite.exe: N 00194
I have attached a small sample project that will reproduce the issue. Again, note, you will not receive the exception if you run on a development machine.
Thanks!
Steve
SqlServerTypesException.zip (248.0 KB)