MAPBOX PROBLEM

Topics: SharpMap v0.9 / v1.x, WinForms Controls
Jan 21, 2013 at 11:44 AM
Edited Jan 21, 2013 at 11:44 AM

I downloaded the latest source code and compiled it without any problems.  Put together a Winforms app.

 

I can load ESRI shape files and XY points from an access db perfectly.  My problem arises when I set the activeTool is DrawPolygon.  I place the mouse cursor over the MapBox... the cursor changes to the cross-hairs as soon as I do a left click to start my first polygon vertex an error is raised thus...

MapBox.cs throws... an exception {"Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index"}

Stack dump below...

'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\James\Documents\Visual Studio 2010\Projects\CSHARPMAP_MYBUILD\CSHARPMAP_MYBUILD\bin\Debug\CSHARPMAP_MYBUILD.vshost.exe', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Deployment\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Deployment.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.The thread 'vshost.NotifyLoad' (0x860) has exited with code 0 (0x0).The thread '<No Name>' (0x13fc) has exited with code 0 (0x0).The thread 'vshost.LoadReference' (0x1250) has exited with code 0 (0x0).'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\James\Documents\Visual Studio 2010\Projects\CSHARPMAP_MYBUILD\CSHARPMAP_MYBUILD\bin\Debug\CSHARPMAP_MYBUILD.exe', Symbols loaded.'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\James\Documents\Visual Studio 2010\Projects\CSHARPMAP_MYBUILD\CSHARPMAP_MYBUILD\bin\Debug\SharpMap.UI.dll', Symbols loaded.'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\James\Documents\Visual Studio 2010\Projects\CSHARPMAP_MYBUILD\CSHARPMAP_MYBUILD\bin\Debug\GeoAPI.dll''CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\James\Documents\Visual Studio 2010\Projects\CSHARPMAP_MYBUILD\CSHARPMAP_MYBUILD\bin\Debug\Common.Logging.dll''CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.no configuration section <common/logging> found - suppressing logging output'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\James\Documents\Visual Studio 2010\Projects\CSHARPMAP_MYBUILD\CSHARPMAP_MYBUILD\bin\Debug\SharpMap.dll', Symbols loaded.'CSHARPMAP_MYBUILD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\James\Documents\Visual Studio 2010\Projects\CSHARPMAP_MYBUILD\CSHARPMAP_MYBUILD\bin\Debug\NetTopologySuite.dll'A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll

 

If I use the compiled sharpmap.dll (from the main SharpMap page) the polygon drawing routine works OK.

 

Any ideas gratefully received.

 

Thanks

James

Coordinator
Jan 21, 2013 at 11:50 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Jan 23, 2013 at 9:03 PM

Felix

Thanks for the fix. BRILLIANT!!!!

It is now working a treat.

 

Many thanks

James