I have an application that has been in use for a long time now. I recently added some new functionality including gMap. My application works great when I debug or build it out and test. The issue occurs when I publish as a clickonce and then install on my same machine. The app installs and when it tries to run I get the error "WMS Toolbox has stopped working". Looking at the event viewer I see that it is obviously missing dll files related to gMap.
--Event Viewer Fault1--
Description: The process was terminated due to an unhandled exception.
Exception Info: System.DllNotFoundException
at System.Data.SQLite.UnsafeNativeMethods.sqlite3_libversion()
at GMap.NET.CacheProviders.SQLitePureImageCache.Ping()
at GMap.NET.GMaps.SQLitePing()
at GMap.NET.WindowsForms.GMapControl..cctor()
Exception Info: System.TypeInitializationException
at GMap.NET.WindowsForms.GMapControl..ctor()
at wmsToolBox.wmsToolBox.InitializeComponent()
at wmsToolBox.wmsToolBox..ctor()
at wmsToolBox.Program.Main()
--Event Viewer Fault2--
Faulting application name: wmsToolBox.exe, version: 1.0.0.0, time stamp:
0x5d70eddb
Faulting module name: KERNELBASE.dll, version: 10.0.15063.1836, time
stamp: 0xbb572fa7
Exception code: 0xe0434352
Fault offset: 0x000f18e2
Faulting process id: 0x3a8
Faulting application start time: 0x01d563db00e3051a
Faulting module path: C:\windows\System32\KERNELBASE.dll
Report Id: 0bc8cd8f-c137-4cd8-a8d8-880ce20add89
Faulting package full name:
Faulting package-relative application ID:
I have noted that this seems to be a know issue with applications dependent on sqlite.dlls.
Taking suggestions from other posts, here is what I have tried:
- Removing all references from the application and adding them back, making sure they are all updated
- I have tried creating x86 and x64 folders in my app and providing the SQLite.Interop.dll to both folders (This made no changes in the performance of the app)
- I have downloaded the precompiled .net and then placed the System.Data.SQLite.dll near my exe (this caused install errors stating that the dll file already existed in the folder and wouldn't install)
- I have tried adding dll files to the clickonce installation folder and running the app again. (this caused the following error:
Exception Info: System.BadImageFormatException at GMap.NET.CacheProviders.SQLitePureImageCache.Ping() at GMap.NET.GMaps.SQLitePing() at GMap.NET.WindowsForms.GMapControl..cctor())
Sources I have referenced
How to Publish a Winforms App with SQLite using ClickOnce
I also referenced the suggestions at the following site. They are largely the same as the post on SO.