- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 837
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
Make Mailkit AOT/Net9 compatible #1844
Comments
D'oh, I was just hanging out with the Microsoft.iOS and Android team leads for the past 3 days. Wish I had gotten this request a day or two ago. Oh well. It's probably as simple as adding net-9.0 to the tfm's? |
… enums) This helps with jstedfast/MailKit#1844
Needed for jstedfast/MailKit#1844
It seems all of the AOT compatibility issues are in MimeKit and not MailKit. I've fixed the core MimeKit stuff to be AOT compatible (e.g. MimeKitLite should be completely AOT compatible now), but MimeKit still isn't because of all of the reflection needed in the MimeKit.Cryptography namespace - specifically the SqliteCertificateDatabase. I don't see a path to fixing this, unfortunately. |
Part of the ongoing work for jstedfast/MailKit#1844
Part of the ongoing work for issue #1844
Hey @jstedfast , |
Only if you use the MimeKitLite and MailKitLite packages. |
I am now using MailKitLite with AOT compilation for iOS and it functions well. Unfortunally this is not true for Android. The following exception occurs when SendMailAsync is called both in release mode and in debug mode even that the same code is used as for iOS: MailKit.Security.SslHandshakeException: An error occurred while attempting to establish an SSL or TLS connection. The server's SSL certificate could not be validated for the following reasons: ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. |
PS: When I use the same code and the same MailkitLite version with the NetStandard version of my app sending an e-mail under Android functions well. |
That exception doesn't have any thing to do with AOT issues - it looks like an SSL certificate revocation check error (due to some sort of network error). This makes sense that it's different on Android vs iOS because the underlying SSL implementation is being used for this afaik (by the System.Security SslStream class). Try |
Thank you for the explanation. It now also works on Android. |
I am using Mailkit in my app for Windows, Android, and iOS. For iOS I must target SDK V17 now. This is supported by Microsoft.iOS only, not more by Xamarin. To produce a release with VS2022, all assemblies should be AOT compatible. Currently I can't release my app for iOS because MailKit is not AOT compatible.
The text was updated successfully, but these errors were encountered: