开发者

Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I am currently using SQLite for Windows Forms but while running the project it is showing the error:

Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I had added the DLL of System.Data.SQLite.dll but it is showing the same error. Please can any one help me by giving the perfect an开发者_开发百科swer regarding this problem? Thanks in advance


This should fixed my issue. Add the following DLLs.

  • Microsoft Visual C++ Runtime Package
  • SQLite for Windows Runtime

Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)


Use Project "Add Existing Item" and select the sqlite3.dll "As link". Click OK. Choose DLL in project and set "Copy Local" value to True.


Maybe you haven't added the version for the right platform? SQLite is distributed with one X86 (32 bit) assembly and one X64 (64 bit) assembly.

If your application is a 32 bit application you should use the System.Data.SQLite.dll located in the "bin" directory of the System.Data.SQLite distribution, if it is a 64 bit application you should use the one in "bin\x64".

However, from looking at the error message a second time I'm not sure if that's it. Are you making native calls to SQLite? In that case you may have to rename the dll to sqlite3.dll.

As you may know System.Data.SQLite is a bundling of the original native sqlite3.dll and a managed ADO.NET provider (unless you are using some old version in which case I'm not sure - you might need the native sqlite3.dll separately)


In my case I'm working on a UWP project. I had to add a reference to Visual C++ 2015 Runtime for Universal Windows Platform Apps and the error was gone. It can be added in the Reference Manager under Universal Windows > Extensions. Detailed solution can be found here.


After struggling for 3 days,finally found a way to resolve.

As of March 2018,if you try to use sqlite-net via Nuget Package Manager,it adds two files and few reference dlls to your solution independent of type of project UWP or Android etc.

Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

And after that if you compile and run the solution will fail with an exception

Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

This is because it is unable to load sqlite3.dll as it is not added to the solution via NUGET package manger.So you need to add it manually.

To add,first determine your project is 32 bit or 64 bit then download the respective Precompiled Binaries for Windows Runtime from https://www.sqlite.org/download.html and add them manually (copy and paste).

So now your solution will look like below one and it will run without issues.

Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)


I had the same issue when I downloaded the latest sqlite provider and I tried a solution from here but it didnt work, hence I downloaded the earlier version and its works fine.


Had this problem recently - after attaching procmon to my process, I found that the latest System.Data.SQLite libs (the ones built for .NET4) have a dependency on the MSVC 2010 runtime, and the servers didn't have this installed. Fortuantly, this can be pulled down from the Microsoft website.


I had exactly the same problem for the UWP project in a Xamarin.Forms application. Adding reference to "SQLite for Universal Windows Platform" to the UWP project solved the problem.

Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)


Copy sqlite3.dll to the System32 folder. It worked for me. And thanks too!


I'm building a native Windows Phone 8.1 app with a PCL and a Droid project. I had the same error and I put the reference to the right version of sqlite3.dll (wpa81) and all worked.


Especially if you've updated to Visual Studio 2015 RTM and are developing Universal Windows apps, try uninstalling the SQLite for Universal App Platform extension and reinstalling (see http://sqlite.org/download.html).


All of these seem to be solutions for certain situations. For me, and for @Marlon Ticao on this page, the application just can't find the DLL.

There are 2 solutions. Copy it to a directory that is in you path (such as System32) or you can copy it into the same directory that your executable is.


I had this exact problem using a 3rd party built sqlite3.dll -- the app would not launch. I used the dependency walker to find that this sqlite3.dll had a dependency on msvcr110.dll. Once I included this file, all was well.


Don't forget to deploy the published runtimes folder too in .NET (Core) projects, it should contain that DLL for various targets.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜