jstedfast / MimeKit

A .NET MIME creation and parser library with support for S/MIME, PGP, DKIM, TNEF and Unix mbox spools.
http://www.mimekit.net
MIT License
1.82k stars 369 forks source link

SQLite is not available. Install the System.Data.SQLite nuget package. #1035

Closed PrzemyslawKlys closed 4 months ago

PrzemyslawKlys commented 4 months ago

I've been following S/MIME example https://mimekit.net/docs/html/Working-With-SMime.htm and while it makes sense in shown case that I get SQLite is not available. Install the System.Data.SQLite nuget package. I am not sure why is it needed when I am using DefaultSecureMimeContext? I don't have any calls to SQLLite or anything, yet it complains about if I remove SqlLite? Is this some internal requirement?

using (var ctx = new DefaultSecureMimeContext()) {
    try {
        var signer = new CmsSigner(certificate) {
            DigestAlgorithm = DigestAlgorithm.Sha1
        };
        message.Body = MultipartSigned.Create(ctx, signer, message.Body);

    } catch (Exception ex) {
        // Settings.Logger.WriteWarning($"Send-EmailMessage - Error: {ex.Message}");
        // Settings.Logger.WriteWarning($"Send-EmailMessage - Possible issue: Certificate? ({certificate.Thumbprint} was used).");
        if (ErrorAction == ActionPreference.Stop) {
            throw;
        }
        return new SmtpResult(false, EmailAction.SMimeSignature, SentTo, SentFrom, Server, Port, stopwatch.Elapsed, ex.Message);
    }
}
PrzemyslawKlys commented 4 months ago

never mind, I see it's internally using it: