Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

There is no metadata information for provider 'SqlServer-20'

I want to test the SQL database features of Quartz.NET 3.0 for .NET Core. Unfortunately, I'm unable to configure the StdSchedulerFactory properly, I always get the following exception when calling StdSchedulerFactory.GetScheduler:

System.ArgumentOutOfRangeException: 
There is no metadata information for provider 'SqlServer-20'
Parameter name: providerName
   at Quartz.Impl.AdoJobStore.Common.DbProvider.GetDbMetadata(String providerName)
   at Quartz.Impl.AdoJobStore.Common.DbProvider..ctor(String dbProviderName, String connectionString)
   at Quartz.Impl.StdSchedulerFactory.<Instantiate>d__66.MoveNext()

I've configured the factory with the following values:

var configuration = new NameValueCollection
{
    { "quartz.jobStore.type", "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz" },
    { "quartz.jobStore.driverDelegateType", "Quartz.Impl.AdoJobStore.SqlServerDelegate, Quartz" },
    { "quartz.jobStore.tablePrefix", "QRTZ_" },
    { "quartz.jobStore.dataSource", "default" },
    { "quartz.dataSource.default.connectionString", "Server=(localdb)\\mssqllocaldb;Database=QuartzTest;Trusted_Connection=True;MultipleActiveResultSets=true" },
    { "quartz.dataSource.default.provider", "SqlServer-20" },
    { "quartz.jobStore.useProperties", "true" },
    { "quartz.serializer.type", "json" }
};

var schedulerFactory = new StdSchedulerFactory(configuration);

As you can see, I'm currently targeting LocalDB (v12.0.2000). I also checked it on SQL Server Express - same result.

How can I avoid this exception?

  • Did I miss any properties that I should configure?
  • Do I have to provide some data for the database? I only executed the tables_sqlServer.sql script.
  • The SqlServer-20 database driver should be installed as part of .NET 3.5, or is there a separate installation necessary?
  • Does Quartz.NET currently not support this functionality for .NET Core? I'm using version 3.0.0-alpha2.
  • Should I target other NuGet packages? I referenced Quartz and Quartz.Serialization.Json
like image 778
feO2x Avatar asked Feb 05 '23 16:02

feO2x


2 Answers

Currently according to changelog for beta1 there are no versions for providers. So correct provider configuration for SqlServer is:

["quartz.dataSource.sqlserver.provider"] = "SqlServer"

Source: https://github.com/quartznet/quartznet/blob/e3ff6936ea1a76480b7671e2b5c468c1b67f4897/changelog.md#release-30-beta-1-oct-8-2017

like image 171
LadislavBohm Avatar answered Feb 08 '23 15:02

LadislavBohm


A friend of mine just found the answer: according to this example on Github, you have to use SqlServer-41 instead of SqlServer-20 in .NET Core projects.

like image 30
feO2x Avatar answered Feb 08 '23 16:02

feO2x