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: 188.8.131.52, 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:
Sources I have referenced
I also referenced the suggestions at the following site. They are largely the same as the post on SO.
Unfortunately, I am having the same issue. I'm hoping you have a solution...
I have seen some of those solutions, but not tried any. One solution I found was to download the GMAP sources and compile it as an AnyCode version, but I don't know how to do that.
I was finally able to resolve this issue. As elwood472 stated, it is very similar to the notes he provided. I have a few subtle additions to offer to be even more concise. This assumes that you have added the references to your application.
Publish the application and it finally worked for me. I think I had been getting incorrect framework versions by searching for the file. Elwood472 offered to use the directory: \Solution Name\packages\System.Data.SQLite.Core.184.108.40.206\lib\net46\ which can be incorrect per the framework you are building your app for. I'm not sure if there is a difference in the x86 and x64 files but I copied them to their respective folders and it worked fine.
If you have the wrong framework version you will likely get an error in Event Viewer that says Exception Info: System.BadImageFormatException
If you are missing the dll files all together you will likely get an error in Event Viewer that says Exception Info: System.DllNotFoundException
I have resolved this for myself using known solutions. I'll be specific since if it had been explained to me this way I would have gotten it done much quicker. It involves creating the x64 and x86 folders.
In Visual Studio, look at your Solution Explorer. Under the root of your project, add a folder for x64 and another for x86.
For each folder, right-click, select Add and then choose existing item. Add the file SQLite.Interop.dll to it. When you're done you MUST be able to see the folder and file in the Solution explorer.
In Solution Explorer, select the file SQLite.Interop.dll. In the properties, set Copy to Output Directory to "Copy if Newer". Do this for each folder (x86 and x64).
That's it. When you publish your project it should now work.
User contributions licensed under CC BY-SA 3.0