-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MailKit Dependency Injection With Quartz #31
Comments
I thought this might become an issue, but no one had complained about it so I wasn't sure. Here's the reason from Microsoft: "Services resolved from the container should never be disposed by the developer." https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection-guidelines#disposal-of-services |
Please check the latest preview release. |
Thanks Daniel. |
I'd written my own file writer that was set as follows: Please check it works and close this issue if it does. |
Thanks for helping out Daniel. Closing the ticket and looking forward for stable release. |
Jeffrey Stedfast himself (of MailKit fame) replied to our query with some suggestions on how to improve performance by using UniqueIdSet with UniqueIdRange, so please try out the latest release. |
Dear Daniel,
I am injecting the MailKitSimplifiedEmailReceiver in QuartzHostedService and using it in Quartz job, but due to following error Quartz job is not firing again, also the log is not being written:
warn: MailKitSimplified.Receiver.Services.LogFileWriterQueue[0]
Log queue cancelled while logs are still being written.
fail: Quartz.Core.QuartzSchedulerThread[0]
Runtime error occurred in main trigger firing loop.
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'LoggerFactory'.
at Microsoft.Extensions.Logging.LoggerFactory.CreateLogger(String categoryName)
at Quartz.Simpl.MicrosoftLoggingProvider.GetLogger(String name)
at Quartz.Logging.LogProvider.GetLogger(String name)
at Quartz.Logging.LogProvider.GetLogger(Type type, String fallbackTypeName)
at Quartz.Core.JobRunShell..ctor(IScheduler scheduler, TriggerFiredBundle bundle)
at Quartz.Impl.StdJobRunShellFactory.CreateJobRunShell(TriggerFiredBundle bndle)
at Quartz.Core.QuartzSchedulerThread.Run()
The text was updated successfully, but these errors were encountered: