Quartz.Net SQLite 否 table QRTZ_LOCKS

Quartz.Net SQLlite No table QRTZ_LOCKS

我正在尝试创建一个包含 Quartz.Net 调度服务的 .net 5 Worker 服务。我有 Quartz 和 运行。我正在尝试将 SQL lite 添加到持久存储的组合中。但是,我不断收到以下异常。我错过了什么?

异常:

SQLiteException: SQL logic error
no such table: QRTZ_LOCKS

配置代码:

services.AddQuartz(q =>
{
    // Use a Scoped container to create jobs. I'll touch on this later
    q.UseMicrosoftDependencyInjectionJobFactory();

    q.UsePersistentStore(c =>
    {
        c.UseSQLite(@"URI=file:MyDatabase.sqlite;Version=3;");
        
        c.UseJsonSerializer();
        //c.UseBinarySerializer(); This option didn't make a difference 
    });
});

您需要在 Quartz.Net 尝试访问它们之前创建这些表。这是一个示例设置文件。

https://github.com/Leftyx/QuartzNetAdoJobStoreSQLite/blob/master/QuartzNetAdoJobStoreSQLite/tables_sqlite.sql