2

I have a WebApp on Azure that uses a dll. This library needs Interop libraries x86 and x64. Sometimes, at the restart of the App (I suppose), the App fails due to an exception:

System.EntryPointNotFoundException: Unable to find an entry point named    'sqlite3_config' in DLL 'SQLite.Interop.dll'. at System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum op) at System.Data.SQLite.SQLite3.StaticIsInitialized() at System.Data.SQLite.SQLiteLog.Initialize() at System.Data.SQLite.SQLiteConnection..ctor(String connectionString, Boolean parseViaFramework) at T_Dox.WebService.SQLiteDb.CreateConnection() at WebService.CeDb.Connect()

The SQLite used is the SQLCipher's one. What am I missing here? I don't understand why the app stops working suddenly even if I don't make any changes.


The App is a Web Service (.asmx file) that uses a data access layer to perform some business logic.

It was under a web site project, then we moved it into another project, a webapi\mvc project. The routing bypasses this extension, so it works as before, a simple web service call.

The called web method initializes a business class loaded from another .net library (a VB.Net library). Inside, this class uses a wrapper to a sqlConnection, in this case the SQLiteConnection. In its constructor it starts an SQLiteConnection, and normally it works. Then it performs some CRUD operations ...

So I can represent the operation this way:

[WebService(Namespace = "...")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class SampleService : System.Web.Services.WebService
{
    [WebMethod]
    public ServerInfo Test()
    {
         var sampleBusinessClass = new SampleBusinessCLass();
         sampleBusinessClass.DoSomething(); 

         using(var connection = new SQLiteConnection()) //the constructor is the parameterless one                  
         {
            //...
         }          
    }
}

And the stack will be this (this is not the real one):

System.EntryPointNotFoundException: Unable to find an entry point named 'sqlite3_config' in DLL 'SQLite.Interop.dll'. 
at System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum op) 
at System.Data.SQLite.SQLite3.StaticIsInitialized() 
at System.Data.SQLite.SQLiteLog.Initialize() 
at System.Data.SQLite.SQLiteConnection..ctor(String connectionString, Boolean parseViaFramework) 
at xxx.WebService.SampleService.Test()

It always works, but sometimes it starts to launch this error until the stop and start of the web application on iss (in our case: Azure).

Inspecting the System.Data.SQlite.dll I can clearly see the entry point and actually it always passes this internal code (no conditions that can bypass this part) and it generally works.

The System.Data.SQlite.dll (1.0.96.0 version) is provided by SqlCypher product. I think it is the original System.Data.SQLite one because at first sight I can see the same assembly manifest and content. The interop System.Data.SQLite uses is probably modified by SqlCypher team to give their features. To avoid possible issues we put the interop in the path /bin/x64, then we compile our web app ONLY in x64 and it runs on a x64 environment.

Francesco
  • 50
  • 6
  • What kind of app is this? MVC? Where is your code are you attempting to call into this DLL? – Chris Gillum Jan 28 '16 at 18:26
  • I update with more info – Francesco Jan 29 '16 at 09:04
  • I have this same issue with the sql server types native dll -- it will deploy fine, then randomly start to fail with System.EntryPointNotFoundException. If I restart the webapp, the issue goes away. It's like it starts running in x64 instead of x86 at some point, though I've run in x64 and still randomly get this issue. – David Faivre Sep 06 '16 at 17:14
  • Has anyone ever found a solution to this? I'm having the same issue on azure with a LIBSASS interop library - though I'm using the same DLL in numerous other live projects and not having the issue. – Alex C Mar 09 '18 at 14:49

0 Answers0