1
我在使用sqlite到azure時部署.net核心應用程序時遇到困難。我得到我的日誌中的錯誤信息是:.Net核心和Sqlite部署到azure失敗
fail: Microsoft.EntityFrameworkCore.Query.RelationalQueryCompilationContextFactory[1]
An exception occurred in the database while iterating the results of a query.
Microsoft.Data.Sqlite.SqliteException: SQLite Error 1: 'no such table: AspNetUserLogins'.
at Microsoft.Data.Sqlite.Interop.MarshalEx.ThrowExceptionForRC(Int32 rc, Sqlite3Handle db)
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
at Microsoft.Data.Sqlite.SqliteCommand.<ExecuteDbDataReaderAsync>d__53.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
這使我相信,沒有被正確應用我的遷移。
在我的啓動類我有以下幾點:
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlite(Configuration.GetConnectionString("ConnectionName")));
和一個連接字符串:
"ConnectionName": "Filename=./MyApp.sqlite"
這工作完全在本地,但是當我部署到蔚藍我得到了給定的錯誤。任何想法出了什麼問題,我可以採取哪些措施來解決它?