在我将asp.net core 2.0应用程序安装到我的raspberry pi B3之后,我从Windows PowerShell收到以下错误消息:
Application started. Press Ctrl+C to shut down.
fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HLD7KSSQUCOB", Request id "0HLD7KSSQUCOB:00000002": An unhandled exception was thrown by the application.
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 14: 'unable to open database file'.
at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
at Microsoft.Data.Sqlite.SqliteConnection.Open()
代码中的我打开Data.db:
public partial class DatabaseEntities : DbContext
{
public DatabaseEntities() : base()
{
}
protected override void OnConfiguring(DbContextOptionsBuilder xOptionsBuilder)
{
xOptionsBuilder.UseSqlite("Data Source=Data\\Data.db");
}
}
在Razor-Pages中,我使用此对象引用DataBase:
public static DatabaseEntities DataBase = new DatabaseEntities();
我不知道如何处理这个问题, 感谢任何回应。 马丁。