- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 838
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
SmtpClient.Dispose throws System.NullReferenceException with OTEL #1816
Comments
Are you calling new |
Also discovered some issues in CreateMetrics() methods in Telemetry class. Fixes issue #1816
No, firstly I tried just:
And it throws on activation:
because |
Gonna close this as fixed, then. I'll try to make a new release later this week (or this weekend). |
Describe the bug
MailService.Dispose
throwsSystem.NullReferenceException
Platform:
<PackageVersion Include="MailKit" Version="4.7.1.1"/>
<PackageVersion Include="MimeKit" Version="4.7.1"/>
Exception
Expected behavior
Should not throw on scope disposing.
Code Snippets
Additional context
If you want to reuse same SmtpClient across the DI scope it's expected that you place SmtpClient in disconnected state, but it will throw on scope
Dispose
becauseDisconnectAsync
dropsuri
field, which is used inClientMetrics.GetTags
on disposing.p.s. also ctor with
IMeterFactory
doesn't work with NRE too.The text was updated successfully, but these errors were encountered: