Skip to content
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.

OSX/coreclr DLL Not found exception with SQLite #121

Closed
natemcmaster opened this issue Aug 31, 2015 · 4 comments
Closed

OSX/coreclr DLL Not found exception with SQLite #121

natemcmaster opened this issue Aug 31, 2015 · 4 comments

Comments

@natemcmaster
Copy link
Contributor

Moved from dotnet/efcore#2964
Original author @salerth


Running my ASPNET5 app on the coreclr on OSX fails to start up when using the SQLite provider. SQLServer provider seems fine (at least it gets further...but I dont have a SQLServer instance to test fully with).

DNVM : * 1.0.0-beta8-15542 coreclr x64 darwin default
DNX : Microsoft .NET Execution environment CoreCLR-x64-1.0.0-beta8-15542
EF Deps :

  EntityFramework.Core 7.0.0-beta8-15538
  EntityFramework.Relational 7.0.0-beta8-15538
* EntityFramework.SqlServer 7.0.0-beta8-15538
* EntityFramework.Sqlite 7.0.0-beta8-15538
System.TypeInitializationException: The type initializer for 'Microsoft.Data.Sqlite.Interop.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'api-ms-win-core-libraryloader-l1-1-0': The specified module could not be found.
 (Exception from HRESULT: 0x8007007E)
   at Microsoft.Framework.Internal.NativeLibraryLoader.GetModuleHandle(String lpModuleName)
   at Microsoft.Framework.Internal.NativeLibraryLoader.IsLoaded(String dllName)
   at Microsoft.Framework.Internal.NativeLibraryLoader.TryLoad(String dllName, String applicationBase)
   at Microsoft.Data.Sqlite.Interop.NativeMethods..cctor()
   --- End of inner exception stack trace ---
   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.Data.Entity.Storage.RelationalConnection.Open()
   at Microsoft.Data.Entity.Sqlite.SqliteDatabaseConnection.Open()
   at Microsoft.Data.Entity.Storage.SqlStatementExecutor.Execute[T](IRelationalConnection connection, RelationalCommand command, Func`2 action)
   at Microsoft.Data.Entity.Sqlite.SqliteDatabaseCreator.HasTables()
   at Microsoft.Data.Entity.Storage.RelationalDatabaseCreator.HasTablesAsync(CancellationToken cancellationToken)
   at Microsoft.Data.Entity.Storage.RelationalDatabaseCreator.<EnsureCreatedAsync>d__26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Kraken.Models.SampleData.<InitializeDatabaseAsync>d__0.MoveNext()
System.DllNotFoundException: Unable to load DLL 'api-ms-win-core-libraryloader-l1-1-0': The specified module could not be found.
 (Exception from HRESULT: 0x8007007E)
   at Microsoft.Framework.Internal.NativeLibraryLoader.GetModuleHandle(String lpModuleName)
   at Microsoft.Framework.Internal.NativeLibraryLoader.IsLoaded(String dllName)
   at Microsoft.Framework.Internal.NativeLibraryLoader.TryLoad(String dllName, String applicationBase)
   at Microsoft.Data.Sqlite.Interop.NativeMethods..cctor()
@natemcmaster
Copy link
Contributor Author

Confirmed bug. This used to work with #113 but something has changed.

@natemcmaster
Copy link
Contributor Author

It turns out https://www.myget.org/F/aspnetlitedev/ started publishing a version of System.Runtime.InteropServices.RuntimeInformation that always returns true on RuntimeInformation.IsOSPlatform(OSPlatform.Windows).

This issue identifies that we have bigger problems in DNX about packages and platforms.

aspnet/dnx#2594

@natemcmaster
Copy link
Contributor Author

Fingers crossed we get a better implementation of OS platform detection https://github.com/dotnet/corefx/issues/3032 In the meantime, we may need a better workaround.

@RedQueen87
Copy link

Can you take a look on #1957

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants