Problem with updating Visual Studio 2017: unable to load sqlite3 dll file: the specified module was not found. (Exception from HRESULT: 0x8007007E)

When updating the vs2015.net standard to vs2017, I received the following error in a test project.

Unable to load DLL 'sqlite3: the specified module was not found. (Exception from HRESULT: 0x8007007E)

It works well with vs2015, sqlite provider 1.0.101.0

New environment: Visual Studio 2017, TargetFramework = "net461" using .netcore1.1 packages, sqlite provider 1.0.105.0

I tried all the permissions that I can get from the Internet as follows, but all in vain. I tried,

  • Added below lines in .csproj, <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType><AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
  • Selected test processor as x86
  • : sqlite-netFx46-static-binary-bundle-Win32-2015-1.0.105.0.zip http://system.data.sqlite.org

  • System.Data.SQLite 1.0.105 nuget

  • sqlite3.dll(x86) , "" " ", bin/x86/, .

. ( HRESULT: 0x8007000B)

at Microsoft.Data.Sqlite.Interop.NativeMethods.Sqlite3_sqlite3.sqlite3_open_v2(IntPtr filename, Sqlite3Handle& ppDb, Int32 flags, IntPtr vfs)
   at Microsoft.Data.Sqlite.Interop.NativeMethods.Sqlite3_sqlite3.open_v2(IntPtr filename, Sqlite3Handle& ppDb, Int32 flags, IntPtr vfs)
   at Microsoft.Data.Sqlite.Interop.NativeMethods.sqlite3_open_v2(String filename, Sqlite3Handle& ppDb, Int32 flags, String vfs)
   at Microsoft.Data.Sqlite.SqliteConnection.Open()
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open()
   at Microsoft.EntityFrameworkCore.Storage.Internal.SqliteRelationalConnection.Open()
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable.Enumerator.BufferlessMoveNext(Boolean buffer)
   at Microsoft.EntityFrameworkCore.Storage.Internal.NoopExecutionStrategy.Execute[TState,TResult](Func`2 operation, Func`2 verifySucceeded, TState state)
   at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, Func`2 operation, TState state)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable.Enumerator.MoveNext()
   at Microsoft.EntityFrameworkCore.Query.QueryMethodProvider.<_ShapedQuery>d__3`1.MoveNext()
   at Microsoft.EntityFrameworkCore.Query.QueryMethodProvider.<_Include>d__30`1.MoveNext()
   at Microsoft.EntityFrameworkCore.Query.QueryMethodProvider.<_Include>d__30`1.MoveNext()
   at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.<_TrackEntities>d__15`2.MoveNext()
   at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at 
  1. ++ Runtime 2017
  2. " SQLite "

. ?

+4
1

.

POC 2017, net461 , net461 sqlite, sqlite, enter image description here

sqlite net461, dll bin/x86 bin/x64

enter image description here

x86/sqlite3.dll, x64/sqlite3.dll, "" " " ( ), enter image description here enter image description here

System.Data.SQLite, .

. sqlite 2017

+2

Source: https://habr.com/ru/post/1674750/


All Articles