System.DllNotFoundException on Mono SQLite

后端 未结 5 555
臣服心动
臣服心动 2020-12-15 00:03

I\'ve been trying to figure this out lately. It is working on my Windows machine, where I got SQLite from NuGet, but...

When I put System.Data.SQLite.dll

5条回答
  •  误落风尘
    2020-12-15 00:27

    I started the development in Windows, but then moved the application to Mono (Ubuntu 14), which is where the SQLite provider failed to load as OP described.

    I had to recompile the System.Data.SQLite.dll using the following command:

    MSBuild System.Data.SQLite.2012.csproj /t:Rebuild /p:UseInteropDll=false /p:UseSqliteStandard=true 
    

    However, after this I've got the following exception:

    The provider did not return a ProviderManifest instance. Method System.Data.SQLite.UnsafeNativeMethods:GetSettingValue (string,string)' is inaccessible from methodSystem.Data.SQLite.EF6.SQLiteProviderManifest:GetProviderManifestToken (string)'

    To fix this, I had to recompile the System.Data.SQLite.EF6.dll using the following command:

    MSBuild System.Data.SQLite.EF6.2012.csproj /t:Rebuild /p:UseInteropDll=false /p:UseSqliteStandard=true
    

    After copying all of the generated files to Mono project's bin directory, everything worked.

    The SQLite provider source code version I had used was 1.0.98.1.

    Hope this saves someone a lot of time...

提交回复
热议问题