This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
1. I've installed the SQLite ADO.NET provider 2. I've added an SQLite database to the server explorer 3. I've created a LS Model "MySQLiteMode.lsmodel" 4. I've dragged a table "EventsLog" from the Database to the model's designer surface 5. I've added the code below : using System; }; I'm getting a FileNotFoundException : Could not load file or assembly 'System.Data.SQLite, Version=1.0.62.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. The system cannot find the file specified.
What seems to be the problem? |
|
|
Please note that the file containing the database is not a member of the solution. I'm actually attempting to prepare for a scenario, where I load a SQLite db fiel for reading via a OpenFileDialog. I'd really apreciate some help on this.
Cheers |
|
|
Have a look in c:\windows\assembly and see which version(s) of System.Data.SQLite you have installed. If you don't have 1.0.62.0, you'll need to either install that specific version, or set up a binding redirect to tell LightSpeed it's okay to use whichever version you do have installed. |
|
|
It appears that I have 1.0.65, what should I do? |
|
|
I've installed 1.0.62 which fixed the problem, but I'd still like to learn about the redirections you've mentioned.
Cheers |
|
|
Have a google around for "binding redirect" or "assembly binding redirection." Basically it's a config element that allows you to say "when someone asks for version X of this assembly, give them version Y instead." E.g. when someone (LightSpeed) asks for v1.0.62 of SQLite, give them v1.0.65 instead. Couple of quick MSDN links: http://msdn.microsoft.com/en-us/library/2fc472t2%28VS.80%29.aspx |
|
|
So, what you're saying is : If I were to include that said assembly in my project's 3rdParty folder, I could basically tell lightspeed to look for that thing in that particular folder etc? |
|
|
Sort of. But the binding redirect is an instruction to the CLR, not to LightSpeed: "When someone asks for SQLite v.1.0.62, give them SQLite v.1.0.65 instead." You're not telling LightSpeed anything; LightSpeed doesn't know that the CLR is giving it the "wrong" assembly. But yeah, the upshot is that LightSpeed will end up loading v.1.0.65 instead of v.1.0.62. I think this will work whether v.1.0.65 is in the GAC or the project folder. |
|
|
How would the above apply to a scenario where I create a project with an installer, deploy the project to some machine? Do I still need to install the SQLite provider on that other machine as well? |
|
|
What I have in mind is - can't I include the System.Data.SQLite.dll and tell Lightspeed to look for the one that shipped with the installer? |
|
|
Yes, you can (and must) include System.Data.SQLite.dll. You do NOT need to install the full SQLite provider (normally) -- just the DLL will do. Yes, you can tell the CLR to redirect to the version of SQLite that shipped with the installer, by including a suitable bindingRedirect element in the .config file you include in the installer. (Or, of course, you can ship v.1.0.62 of the DLL in your installer, in which case you don't need the redirect.) |
|