0

So I have the following config file (quartz.config)

<add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
<add key="quartz.threadPool.threadCount" value="1" />
<add key="quartz.threadPool.threadPriority" value="1" />

<add key="quartz.jobStore.type" value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz" />
<add key="quartz.jobStore.misfireThreshold" value="180000" />
<add key="quartz.jobStore.dataSource" value="quartzDS" />
<add key="quartz.jobStore.driverDelegateType" value="Quartz.Impl.AdoJobStore.SqlServerDelegate, Quartz" />
<add key="quartz.jobStore.lockHandler.type" value="Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz" />
<add key="quartz.jobStore.tablePrefix" value="QRTZ_" />
<add key="quartz.jobStore.clustered" value="true" />
<add key="quartz.jobStore.useProperties" value="false" />

<add key="quartz.dataSource.quartzDS.provider" value="SqlServer-20" />

I want when I start my web api to loop over a list of tenants and add a section for the connection string name (each one for a tenant).

I'm done with everything but the last part where I need to edit the config file before launching a scheduler (for each tenant).

I looked for many solutions but all of them were about changing/adding a field in the web.config like this or this without having the option to add/edit a field to a different config file.

Ali_Nass
  • 838
  • 1
  • 9
  • 27
  • Could you wrap quartz config settings in `` element and include quartz.config in web.config appsettings section with ``? Or create a `QuartzSettings` section in web.config? – Sakis Jan 24 '18 at 21:36

1 Answers1

0

you can see this question, basically you change the section type in the configuration file from System.Configuration.NameValueSectionHandler to System.Configuration.AppSettingsSection

Modify custom app.config config section and save it

  • the settings I want to change are NOT appSettings so this method did not work for me, anyway I fixed the problem using this [way](https://stackoverflow.com/questions/48497228/how-to-add-a-field-in-my-quartz-configuration-dynamically). – Ali_Nass Feb 02 '18 at 12:05