Skip to content
Discussion options

You must be logged in to vote

The error doesn't come from MailKit's own code but from a dependency that changed in 4.18.0. Comparing the netstandard2.0 dependencies on NuGet:

  • MimeKit 4.17.0 uses System.Security.Cryptography.Pkcs 8.0.1.
  • MimeKit 4.18.0 uses System.Security.Cryptography.Pkcs 10.0.0 (and MailKit moved System.Formats.Asn1 from 8.0.1 to 10.0.0).

System.Security.Cryptography.Pkcs 10.0.0 adds a new dependency for netstandard2.0, Microsoft.Bcl.Cryptography 10.0.0, and that package includes the BCryptSetProperty P/Invoke from your error, which passes a ReadOnlySpan<byte> to native code. The .NET Native compiler can't marshal spans across P/Invokes, so it fails. It only shows up in Release because that's the c…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jstedfast
Comment options

Answer selected by al-kau
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants