My mail-provider has made an update, which generated some problems using Dot.Net Mail in an older Windows Form C# solution. I found, that it is recommended to use MailKit/Mimekit instead of Dot.Net mail. So I decided also to upgrade to newer Visual Studio 2019, where I can use NuGet packages.
I installed Visual Studio 2019, installed MailKit using Manage NuGet Packages (Browse, Right Click, Install) and made a simple test-program in C# (Windows Form Solution) where I send an Email with some attachments.
The solution works 100 % - as long as I execute the solution (both debug and Release builds on the PC where the program is build.
When I copy the Release version (exe-file) to a similar PC (Win 10, DotNet 4.8) I get the following error: Could not load File or Assembly 'Mimekit, Version 2.10.0.0, Culture=neutral, PublicKey Token=bede1c8a46c66814' or one of its dependencies. The same happens if I transfer the exe-file to a Win 7 - PC.
I have
- Checked that both MailKit an MimeKit is listed in the Solutions References
- Tried to uninstall and reinstall both MailKit and MimeKit (version 2.10.0)
- Tried to upgrade MimeKit to version 2.10.1
It is my first solution in Visual Studio 2019 - as well as my first use of a NuGet Package. I expected that the built Release Version could be transferred to another PC as a file copy, but something seems to be missing.
I have no clue what to do !?