SQLite with Metro - Unable to load sqlite3.dll

╄→尐↘猪︶ㄣ 提交于 2019-12-08 08:19:50

问题


I am not able to create a database using SQLite with my Metro application.

Description: I continue to receive a runtime exception on a failure to load SQLite3.dll.

Observation: I observed that the database directory never gets created in the app package's LocalState directory. After observing this, I literally implemented file path creation at runtime and dropped the sqlite3.dll in the intended location.

Yet, I still receive an exception on failed to load SQLite3.dll.

  1. My CRUD code that leverages SQLite compiles fine.
  2. SQLite dependencies (packages.config, SQLite.cs, and sqlite3.dll) are located in a separate metro class library instead of the application's executable project.
  3. The sqlite3.dll is based on the ARM processor.
  4. The sqlite3.dll is set to Content, Copy Always.

Code:

    SQLiteAsyncConnection connection = new SQLiteAsyncConnection(DATABASE_DIRECTORY_NAME);
    return await connection.CreateTableAsync<Service>();

Please help...


回答1:


I got the same error.After that I have placed sqlite3.dll in my root folder of the project the sqlite3.dll is set to Content, Copy Always. after that it's working



来源:https://stackoverflow.com/questions/13001731/sqlite-with-metro-unable-to-load-sqlite3-dll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!