Open Nikolay-Simonov opened 2 years ago
Experiencing the same issue here. It seems the method signature in MailKit changed.
Also experiencing the same issue here, any help would be appreciated.
Update: I downgraded Mailkit to version 2.15 as a temporary solution to get it back working again.
I installed Serilog.Sinks.Email with NuGet Package Manager from Visual Studio 2022. And it installed MailKit 2.6.0. And I experience no problems
The subject of this tickets is incorrect as it is not a .net 6 issue. The problem is that the Serilog.Sinks.Email packages is not compatible with the latest Mailkit version.
I installed Serilog.Sinks.Email with NuGet Package Manager from Visual Studio 2022. And it installed MailKit 2.6.0. And I experience no problems
I have the same version as you, but still having the problem, it doesn't send any email. Serilog.Sinks.Email 2.4.0 MailKit 2.6.0 .NET6
My Project settings are:
<TargetFramework>net6.0</TargetFramework>
<PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Email" Version="2.4.0" />
@fakhrulhilal Can you post the project which is not working? Then I will take a look.
Related to #107
still got the same issue.
I have installed
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.2.0" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="7.0.0" />
<PackageReference Include="Serilog.Sinks.Email" Version="2.4.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="MailKit" Version="4.0.0" />
December 2023 update. This is still an issue with .net 8 and the latest version of Serilog.Sinks.Email. I had to downgrade my mailkit version, and the reinstal Serilog.Sinks.Email.. and the logs started coming.
I would love to find the proper place to track this as Mailkit is way outta date now.
3.0.0-dev-* updates the project to MailKit 4; now on NuGet but needs some testing and feedback as quite a bit of surgery was done :-) - all help appreciated!
My project settings:
SelfLog.Enable(Console.Error) returns the following message:
2022-01-12T13:41:58.1815631Z Exception while emitting periodic batch from Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink: System.MissingMethodException: Method not found: 'System.Threading.Tasks.Task MailKit.MailTransport.Se ndAsync(MimeKit.MimeMessage, System.Threading.CancellationToken, MailKit.ITransferProgress)'. at Serilog.Sinks.Email.EmailSink.EmitBatchAsync(IEnumerable
1 events) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at Serilog.Sinks.Email.EmailSink.EmitBatchAsync(IEnumerable
1 events) at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.OnTick()I checked the dll in debug/net6.0 folder. The folder contains MailKit 3.0.0 built for .NET 5. This DLL has SendAsync methods.
If you build a project for the .NET 5 platform, email logging works and there are no runtime errors.