judero01col / GMap.NET

GMap.NET Windows Forms & Presentation is an excellent open source, powerful, free and cross-platform .NET control. Allows the use of routing, geocoding, directions and maps from Google, Yahoo!, Bing, OpenStreetMap, ArcGIS, Pergo, SigPac, Yendux, Mapy.cz, Maps.lt, iKarte.lv, NearMap, HereMap, CloudMade, WikiMapia, MapQuest and many more.
Other
440 stars 197 forks source link

Access Violation and StackoverflowException #162

Closed mushbi1234 closed 1 year ago

mushbi1234 commented 1 year ago

I wrote a little test program with GMap.Net and was able to run in VS2022. But when I tried to run the same project in VS2019, I am getting StackOverflowException and Access Violation. The code is really simple:

private void Form1_Load(object sender, EventArgs e) { System.Console.WriteLine("Loading"); gmap.MapProvider = GMap.NET.MapProviders.OpenStreetMapProvider.Instance; GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerAndCache; gmap.CacheLocation = @"C:\Temp"; gmap.SetPositionByKeywords("San Diego, CA. USA"); gmap.Zoom = 9; }

When I run the project I get the following output: 'GMapTest.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'GMapTest.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Users\Denny\Source\Repos\GMapTest\GMapTest\bin\Debug\GMapTest.exe'. Symbols loaded. 'GMapTest.exe' (CLR v4.0.30319: GMapTest.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0b77a5c561934e089\System.Windows.Forms.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'GMapTest.exe' (CLR v4.0.30319: GMapTest.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'GMapTest.exe' (CLR v4.0.30319: GMapTest.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0b03f5f7f11d50a3a\System.Drawing.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'GMapTest.exe' (CLR v4.0.30319: GMapTest.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'GMapTest.exe' (CLR v4.0.30319: GMapTest.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'GMapTest.exe' (CLR v4.0.30319: GMapTest.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'GMapTest.exe' (CLR v4.0.30319: GMapTest.exe): Loaded 'C:\Users\Denny\Source\Repos\GMapTest\GMapTest\bin\Debug\GMap.NET.WindowsForms.dll'. Module was built without symbols. 'GMapTest.exe' (CLR v4.0.30319: GMapTest.exe): Loaded 'C:\Users\Denny\Source\Repos\GMapTest\GMapTest\bin\Debug\GMap.NET.Core.dll'. Module was built without symbols. 'GMapTest.exe' (CLR v4.0.30319: GMapTest.exe): Loaded 'C:\Users\Denny\Source\Repos\GMapTest\GMapTest\bin\Debug\System.Data.SQLite.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'GMapTest.exe' (CLR v4.0.30319: GMapTest.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0b77a5c561934e089\System.Data.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'GMapTest.exe' (CLR v4.0.30319: GMapTest.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Native library pre-loader is trying to load native SQLite library "C:\Users\Denny\Source\Repos\GMapTest\GMapTest\bin\Debug\x86\SQLite.Interop.dll"... SQLiteVersion: 3.37.0 | 2021-11-02 14:01:01 b0c4230c89fa729aacfe074159788b5b2ac7a82f42cd25d0dc536bcaca6a93fe | INCLUDE_EXTRA INTEROP_CRYPTOAPI_EXTENSION INTEROP_EXTENSION_FUNCTIONS INTEROP_FTS5_EXTENSION INTEROP_INCLUDE_SEE INTEROP_JSON1_EXTENSION INTEROP_PERCENTILE_EXTENSION INTEROP_REGEXP_EXTENSION INTEROP_SESSION_EXTENSION INTEROP_SHA1_EXTENSION INTEROP_TOTYPE_EXTENSION INTEROP_VIRTUAL_TABLE NET_46 PRELOAD_NATIVE_LIBRARY THROW_ON_DISPOSED TRACE TRACE_PRELOAD TRACE_SHARED TRACE_WARNING USE_INTEROP_DLL USE_PREPARE_V2 WINDOWS Loading 'GMapTest.exe' (CLR v4.0.30319: GMapTest.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0b03f5f7f11d50a3a\System.EnterpriseServices.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'GMapTest.exe' (CLR v4.0.30319: GMapTest.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0b03f5f7f11d50a3a\System.EnterpriseServices.Wrapper.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

Process is terminated due to StackOverflowException. An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll

The program '[7228] GMapTest.exe' has exited with code -1 (0xffffffff).

I am not sure what I am doing wrong.. Any suggestion on where to look?

Thanks Denny

mushbi1234 commented 1 year ago

Nevermind. I reinstall everything and it seems to have fixed the issue.