We use Quartz.net to handle jobs in a .NET Core 7 console application. It runs fine in Visual Studio while debugging. After publishing, it throws this exception:
Unknown configuration property 'quartz.scheduler.instanceName'
We don't set any property and Quartz.net should use its own default value.
StdSchedulerFactory factory = new StdSchedulerFactory();
_scheduler = await factory.GetScheduler();
_scheduler.JobFactory = _serviceProvider.GetService<IJobFactory>();
await _scheduler.Start();
But why it tells that it does not have it? After investigating, I find that when publishing, if I enable "Trim unused code", it produces this error. If I disable "Trim unused code", it is fine.
I want to know what it does by "Trim with code", does it delete some settings inside Quartz.dll?