Error when deploying app via ClickOnce

Topics: General
Aug 2, 2011 at 6:03 PM
Edited Aug 2, 2011 at 6:34 PM

I am deploying my app via ClickOnce, when running the app I get the following error. I also tried including the x86 and x64 folders...same thing. The app runs fine on the development box. What else can I try?

I am not using .NET 4.0 and the BSE.Windows.Forms.dll is not in my project. I also confirm that I have MapControl.Manager.Mode = ServerAndCache


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.TypeInitializationException: The type initializer for 'SingletonCreator' threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.BadImageFormatException: Could not load file or assembly 'System.Data.SQLite, Version=, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'System.Data.SQLite, Version=, Culture=neutral, PublicKeyToken=db937bc2d44ff139'
   at GMap.NET.CacheProviders.SQLitePureImageCache.CreateEmptyDB(String file)
   at GMap.NET.CacheProviders.SQLitePureImageCache.set_CacheLocation(String value)
   at GMap.NET.Internals.Cache.set_CacheLocation(String value)
   at GMap.NET.Internals.Cache..ctor()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
   at System.Activator.CreateInstance[T]()
   at GMap.NET.Singleton`1.SingletonCreator..cctor()
   --- End of inner exception stack trace ---
   at GMap.NET.Singleton`1.get_Instance()
   at GMap.NET.GMaps.set_ImageCacheSecond(PureImageCache value)
   at MapView.frmMain.InitMap()
   at MapView.frmMain.frmMain_Load(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at DevExpress.XtraEditors.XtraForm.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at DevExpress.XtraEditors.XtraForm.WndProc(Message& msg)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Aug 2, 2011 at 6:42 PM

I found the problem...although I was deploying the x86 and x64 folders, the System.Data.SQLite.DLL was also deployed separately. I just removed the dll and all works. Question though, can't I tell the map control not to use the local SQLite cache and use the ImageCacheSecond instead?

Aug 2, 2011 at 7:25 PM

it uses both, leave it so, or recompile without SQLite conditional symbol, not recommended action, ...and give a try to latest version in source, it manages sqlite deployment automatically, so you don't need to manually add folders for it