Skip to content
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

.NET 5: "SQLite is not available" exception when using DefaultSecureMimeContext #673

Closed
fabioarnold opened this issue May 4, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@fabioarnold
Copy link

Describe the bug
When using the DefaultSecureMimeContext the following exception is thrown:
System.NotSupportedException: 'SQLite is not available. Install the System.Data.SQLite nuget.'

StackTrace:

   at MimeKit.Cryptography.DefaultSecureMimeContext.CheckIsAvailable()
   at MimeKit.Cryptography.DefaultSecureMimeContext..ctor(String fileName, String password)
   at MimeKit.Cryptography.DefaultSecureMimeContext..ctor()
   at MimeKit.Cryptography.CryptographyContext.Create(String protocol)
   at MimeKit.Cryptography.MultipartSigned.Create(CmsSigner signer, MimeEntity entity)

I have the System.Data.SQLite NuGet package installed. If I change the project from .NET 5 to .NET Core 3.1 it works fine.

Another workaround is to register a new default SecureMimeContext:

CryptographyContext.Register(typeof(MySecureMimeContext));

Platform (please complete the following information):

  • OS: Windows 10
  • .NET Runtime: CoreCLR
  • .NET Framework: .NET 5
  • MimeKit Version: 2.11.0

To Reproduce
Steps to reproduce the behavior:
Use any of the functions which don't take a custom context but make use of DefaultSecureMimeContext (e.g.: MultipartSigned.Create(CmsSigner, MimeEntity)). If needed I could provide a small sample program but it requires a certificate file.

Expected behavior
MimeKit should detect the presence of System.Data.SQLite.

@jstedfast jstedfast added the bug Something isn't working label May 5, 2021
@adelmurad24
Copy link

after hours of searching, I just have to copy the file SQLite.Interop.dll.
It lives in bin\x86 and bin\x64 so i copied the two folders to my production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants