我正在使用 EntityFrameworkCore.Sqlite.NetTopologySuite 創(chuàng)建一個(gè)空間數(shù)據(jù)庫(kù)來(lái)暫時(shí)存儲(chǔ)一個(gè)點(diǎn),但最終將用于線等。我已使用空間數(shù)據(jù)文檔作為參考https://learn.microsoft.com/en-us/ef /核心/建模/空間#sqlite。數(shù)據(jù)需要保存到 Spatialite 數(shù)據(jù)庫(kù)中。閱讀完文檔后,我已經(jīng)反映了代碼,因?yàn)樗ㄟx項(xiàng)生成器中的“UseNetTopology”(如下),并在類中創(chuàng)建了一個(gè)點(diǎn)。protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseSqlite("Filename=TestDb.db", x => x.UseNetTopologySuite()); }當(dāng)我嘗試更新數(shù)據(jù)庫(kù)時(shí),update-database我收到錯(cuò)誤:SQLite Error 1: 'The specified module could not be found.'. 我試圖通過(guò)創(chuàng)建一個(gè)空白項(xiàng)目并從頭開(kāi)始工作來(lái)找到問(wèn)題,但結(jié)果出現(xiàn)相同的錯(cuò)誤。這是整個(gè)日志:'. at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db) at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior) at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery() at Microsoft.EntityFrameworkCore.Infrastructure.SpatialiteLoader.Load(DbConnection connection) at Microsoft.EntityFrameworkCore.Sqlite.Storage.Internal.SqliteRelationalConnection.LoadSpatialite() at Microsoft.EntityFrameworkCore.Sqlite.Storage.Internal.SqliteRelationalConnection.Open(Boolean errorsExpected) at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues) at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists() at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration) at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)SQLite Error 1: 'The specified module could not be found.'.我找不到任何其他有同樣問(wèn)題的帖子。編輯 19/8/19: 我剛剛創(chuàng)建了一個(gè)新的空白項(xiàng)目,通過(guò)從 Spatialite 網(wǎng)站安裝并使用 SQLite 連接到空間數(shù)據(jù)庫(kù)來(lái)在沒(méi)有實(shí)體框架的情況下進(jìn)行測(cè)試。我以手動(dòng)方式收到了同樣的錯(cuò)誤,所以這也許是 Spatialite 的問(wèn)題?
1 回答

萬(wàn)千封印
TA貢獻(xiàn)1891條經(jīng)驗(yàn) 獲得超3個(gè)贊
mod_spatialite\4.3.0.1\runtimes\win-x64\native
@Jarb ,在我的例子中,我通過(guò)手動(dòng)將內(nèi)容復(fù)制到項(xiàng)目的 bin 文件夾中解決了(暫時(shí))問(wèn)題bin\Debug\netcoreapp2.2\win10-x64
- 1 回答
- 0 關(guān)注
- 162 瀏覽
添加回答
舉報(bào)
0/150
提交
取消