Runtime Error

Apr 15, 2009 at 4:08 AM
I compiled Demo Winform and it build succeed but error occured when I start running program.
At       ret = Cache.Instance.GetImageFromCacheDB(type, pos, zoom, language);

Could not load file or assembly 'System.Data.SQLite, Version=1.0.60.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format

I check referenced SQLlite already , no problem with reference file.
What happen ? need help

Thank you
Mickey
Coordinator
Apr 15, 2009 at 7:49 AM
make sure you set option to reference: 'copy local', otherwise you can manualy copy sqlite dll to your working application dir
Apr 15, 2009 at 11:22 AM
I already did that but it show same result. Compiling is done , running manually from DEBUG directory is fine but can not run it from Visual Studio. I am using VS2008

Coordinator
Apr 15, 2009 at 12:21 PM
ahh.. i think you forget to set working directory:

 
Apr 16, 2009 at 1:01 AM
I set it to ..\gmap4dotnet-32924\Trunk\Build\Debug\  but it still show same error. Any suggestion?
Coordinator
Apr 16, 2009 at 1:47 PM
strange o.O
Coordinator
Apr 20, 2009 at 11:08 AM
it is posible you use 64bit system?
Sep 24, 2009 at 3:30 PM

I'm getting a similar error. I am just starting out with GMap and I'm building a WPF application, and I've copied some code from your demo application. I have also referenced all three dll's in the download, with version 1.3.8.4 (WindowsPresentation). But, I'm unable to build, with the following error:

 

Error 1 Unknown build error, 'Could not load file or assembly 'file:///C:\Users\Christian\Documents\Visual Studio 10\Projects\Breeze\Libraries\System.Data.SQLite.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)' WindSim.Breeze.Gui

Error 1 Unknown build error, 'Could not load file or assembly '[Path removed]\System.Data.SQLite.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)' [Project name removed]

I'm using Visual Studio 2010 Beta 1. Any ideas, anyone?

 

Coordinator
Sep 24, 2009 at 3:58 PM

set target to x86

Sep 24, 2009 at 4:00 PM

I've done so - no difference... :-(

Coordinator
Sep 24, 2009 at 4:11 PM

rebuild all

Sep 24, 2009 at 4:28 PM

Been there, done that... MANY times :-(

Coordinator
Sep 24, 2009 at 5:38 PM

have no idea ;} it works just perfect

Sep 25, 2009 at 3:45 PM

I think the problem could have something to do with SQLite - which I've never worked with before. It seems System.Data.SQLite.dll requires the native library, but I can't see any documentation on how this should be made available. Could this be the problem? I've tried installing sqlite-dotnet2, with no luck. I've tried turning of cache, with no luck. I've tried removing the reference to System.Data.SQLite.dll, but then I get the same error as before, just regarding GMap.NET.WindowsPresentation.dll instead of System.Data.SQLite.dll. Does anyone know a way to find out exactly what is missing? The error message doesn't say much...

Also - I don't really want to use SQLite - I'd much rather use SQL Compact, which my application already uses. I've seen that this now is supported, but I don't see any description anywhere of how to change this. Must I change the source code of the project and build a custom version, or can this be done with just the built dll? I'd much prefer to rely on the standard built version rather than have to build one myself... But if I have to, I have to...

C.

Coordinator
Sep 25, 2009 at 8:34 PM

does precompiled demos working on your machine?

Sep 28, 2009 at 10:15 AM

Yes, Demo.WindowsPresentation.exe works just fine. 

Coordinator
Sep 28, 2009 at 11:38 AM

then your're missing something ;/

Sep 28, 2009 at 12:02 PM

I gathered as much... but what?

Also - is there a description somewhere to answer my earlier question, about changing the provider to SQL compact?

 

C.

Coordinator
Sep 28, 2009 at 12:12 PM

36821 

by radioman Sep 18 at 

10:42 AM 22 - added MySQL and MsSQL'Ce providers

- set Build Action to Compile on source files in GMap.NET.CacheProviders if you want include them in build

36821 
by radioman Sep 18 at 
10:42 AM 22 - added MySQL and MsSQL'Ce providers
- set Build Action to Compile on source files in GMap.NET.CacheProviders if you want include them in build

 

 

Coordinator
Sep 28, 2009 at 12:27 PM

checked that?

Sep 28, 2009 at 1:57 PM

Yes, I have checked that. 

I have now downloaded the source code (latest), and it builds fine. I have even - just for fun - tried to build and run it with AnyCPU - and that works too! I thought it wasn't supposed to work?

I've also included the CE provider when compiling, but I haven't found a logic way to use that provider and kick out SQLite... From what I see, the GMap class uses the Cache class heavily, which in turn uses SQLite-classes heavily. Just swapping the calls to Cache with MsSQLCePureImageCache gives a lot of errors, as Cache implements a lot of methods MsSQLCePureImageCache doesn't.

Setting the ImageCache property to an instance of MsSQLCePureImageCache might actually use SQL CE as the provider, but it doesn't solve my problem of trying to get rid of SQLite. Is this even possible?

C.

Coordinator
Sep 28, 2009 at 4:02 PM

check latest commit "_^

Sep 28, 2009 at 6:07 PM

Yeay :-) It builds! No time to check that it actually works today, but I'll get to that tomorrow ;-) Thanks a bundle!

All that code that is commented out if SQLiteEnabled is not defined, is not really important? I can get by just fine without it? :-)

Thanks again!

C.

Coordinator
Sep 28, 2009 at 7:07 PM

welcome again! ;}