I've an app in c# and it's working perfect with Sqlite 1.0.84.0 but I should update it to 1.0.89.0.
I replace the dll and some functionalities are not working any more. Im pretty sure that is something related with SQLite.Interop.dll but I don't know how to solve it. Any idea?
Thank you in advanced for the anwer.
I suspect there is a mixup on which dll goes where and how it gets copied to the working directory.
Instead of adding references to SQLite manually, you should add it and update it using its nuget package. The package adds the proper SQLite.dll and Interop.dll files for the current SQLite version and bitness (x86 or x64) and ensures the proper Interop dlls are copied to the debug directory (x86 or x64).
SQLite is a native library so you need to have the proper version for the OS you are targetting. System.Data.SQLite is a library built on top of the native dll, which communicates whith it using the Interop dll.
Related
I am trying to use a SQLite in a Revit App but got the error shown in the image.
the dll is referenced and I put it in the directory but it didn't work.
What is the possible reason?
SQLite for .net have many versions. I do not know which version do you use, but for the Revit, which is only 64bit, I recommend to use this one:
sqlite-netFx45-binary-x64-2012-1.0.108.0.zip.
For this version, two dlls files (at least) need to be put in the app directory:
System.Data.SQLite.dll and SQLite.Interop.dll
So i'm kind of new to programming but i started using Xamarin and i tried to add NHunspell package from NuGet on Xamarin Studio, it downloads it and the .dlls appear in Resources and NHunspell appear in Packets, but it doesn't appear in References and so when i try "using NHunspell" it doesn't work.
I have tried running the "install" script with Power Shell but apparently nothing changed.
How do I add NHunspell to my project?
Not every .NET library is compatible with Xamarin. They generally have to be either built against the appropriate Xamarin Framework, or build using a compatible PCL Profile.
scan.xamarin.com can tell you if a given DLL is compatible or not.
As I answered you already per Email the problem with NHunspell is that it is in fact an wrapper to Hunspell. Hunspell is written in c or C++ so it compiles to a native Dll. At this time the build produces two native DLLs for Windows 32 Bit and 64Bit. It would be necessary to produce native DLLs for ARM / Android or Linux or ... to use it on these platforms. I will do this for X86/X64 Linux in the future. But at the moment I'm snowed under so there is no timeframe. If you or someone else is willing to contribute, you're welcome.
BTW. NHunspell has an resolver for the correct native DLL. If your project has the native DLLs in the output directory, it resolves X86 or x64 in windows. You can do this in Xamarin studio by adding the native DLLs in your project and configure "copy to output directory". But this works only in Windows.
The latest packages (without NuGet) are here:
http://download.crawler-lib.net/NHunspell/
We have two applications that use ILNumerics and have run into the same issue with both. We use the mkl_custom.dll and during development the application runs fine. The dll in use during development sits in the bin32 folder automatically generated when downloading the ILNumerics from nuget. However when we install the applications we get "Unable to load DLL 'mkl_custom': The specified module could not be found. (Exception from HResult: 0x8007007E".
Here is what we have tried:
Building the application in Any CPU, x86.
Switching the bin32 to include the bin64 dll's and viсе-versa.
Running dependency walker and including all dll's that are needed.
Changing path variable.
We are using ILNumerics 3.3.3.0.
One of the dependencies for mkl_custom is msvcr*.dll. Packing this dll manually may work on some operating systems but not all. Make sure the target system has c++ runtime redistributable package installed.
This installs the msvcr dll correctly. Hopefully this should fix the issue
I'm having a bit of a senior moment trying to get SQLite working on a new WPF project. I've recently written a bunch of Windows Store and Phone projects and always used the same neat SQLite-net implementation there, but now I can't seem to do that with my WPF app.
I've added SQLite-net through nuget, but I can't find a version of SQLite3.dll that I can add to the project. When I download it from SQLite.org I get the following error.
What am I doing wrong? All the tutorials I find tell me to use System.Data.Sqlite instead but I don't want to rewrite all my DAL code again
I got it working.
For anyone who's trying to do this - specifically, trying to get sqlite-NET to work on WPF, not just SQLite, you need to:
download the pre-compiled windows binary of sqlite3.dll from http://www.sqlite.org/download.html
copy that dll file into your bin folder
go to project properties > build and change the CPU type to x86 (there's no precompiled x64 version at time of writing)
You need to download and install an appropriate System.Data.SQLite setup package from http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki.
This will install the required SQLIte assemblies into your GAC and the design-time components for Visual Studio.
For .NET 4.5.1 (VS 2013) the current link is http://system.data.sqlite.org/downloads/1.0.92.0/sqlite-netFx451-setup-bundle-x86-2013-1.0.92.0.exe
For .NET 4.5 (VS 2012) the current link is http://system.data.sqlite.org/downloads/1.0.92.0/sqlite-netFx45-setup-bundle-x86-2012-1.0.92.0.exe
For .NET 4 (VS 2010) the current link is http://system.data.sqlite.org/downloads/1.0.92.0/sqlite-netFx40-setup-bundle-x86-2010-1.0.92.0.exe
Once you do that you will be able to add required SQLite assembly references in your project.
Here is a screenshot of SQLite assemblies in Add Reference dialog:
I am new to ServiceStack. I am testing out the MovieREST example. When I run the project, the Immediate Window shows me this error
"A first chance exception of type 'System.DllNotFoundException' occurred in Mono.Data.Sqlite.DLL"
and no movie list is loading up. So, there is only a blank "Add a new movie" page with some default inputs, everytime I hit Add new movie, the DllNotFoundException will be thrown.
Do I need to install any dependency projects to make it work? I am running it with VS2010, IIS, and Vista 32bit (yup..I know..). Also installed Mono and sqlite 32bit just now blindly, I am not even sure if the project needs them to run. From the code, I can see it is referring to "App_Data/db.sqlite" and References already has sqlite3.dll, I replaced the dll with the 32bit one I download anyway, but still no luck.
Please give me some hints on what I am missing? Thank you.
The Mono.Data.Sqlite.DLL is just a managed wrapper that needs to find the unmanaged sqlite3.dll in order to run (which is what holds the native binary of Sqlite itself).
It looks for this in the /bin directory, to have it deployed there whenever you build you need to copy sqlite3.dll to your project root / and set the Build Action to Content and change the Copy action to Copy if newer.
Ideally you'd want to use the right sqlite3.dll for your architecture (the ServiceStack.OrmLite.Sqlite.Mono NuGet package contains both 32bit / 64bit dlls) although IIS/.NET can work with 32bit unmanaged dlls but will require some tweaking explained here.
Using mixed-mode assemblies
Whilst Mono.Data.Sqlite.DLL lets you run the same .NET app on Mono, if you only want to run Sqlite in Windows you can also use the mixed-mode assemblies that have the unmanaged native sqlite library embedded in the .NET dll. There are 2 different versions available on NuGet:
ServiceStack.OrmLite.Sqlite32
ServiceStack.OrmLite.Sqlite64
Remove any references to existing OrmLite or Sqlite dlls as both of these NuGet packages contain all the Sqlite + OrmLite dlls needed.