+1 vote

Hi,

We have been using your component in our Windows App for a number of years and are now experimenting with running on Mono are seeing this error:

Error connecting to Imap server (The type initializer for 'Limilabs.Client.ClientBase' threw an exception.). ---> System.TypeInitializationException: The type initializer for 'Limilabs.Client.ClientBase' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a' or one of its dependencies.
File name: 'log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'
at Limilabs.Mail.Log. () <0x41285b50 + 0x0004f> in :0
at Limilabs.Mail.Log. (System.String ) <0x412858f0 + 0x0007b> in :0

We are not using log4net and do not wish to start - is this something we can turn off or avoid?

Should we be using a special build of the DLLs for Mono?

Thanks,

Chris

related to an answer for: Warning compiling in VS regarding log4net
by (450 points)
retagged by

1 Answer

0 votes

At this point I would say this is a Mono bug.

Mail.dll doesn't require log4net reference. If the library is not found, no type that uses it is instantiated. In such case runtime shouldn't try to load the log4net assembly.

Microsoft's .NET runtime can handle this, seems Mono can't.

At this point your only option would be to simply drop log4net.dll assembly in to the run folder/bin folder of your app.

We already know how to workaround this issue and we are going to fix that in the next release (most likely Tomorrow).

by (297k points)
OK great, does that mean there may be a release even tomorrow we can test with?

Would probably rather wait on that than dropping in log4net.
New version was released:
https://www.limilabs.com/mail/download
Thanks - I think that has fixed that issue. I am now getting a new error:

Error connecting to Imap server (Authenticate as SSL client failed. You might be connecting to non SSL port.)

When trying to run our code from Mono running on Ubuntu on a VM. From windows with the exact same inputs it works OK.

---
Update - you can delete or ignore this, I followed the advice here:
https://www.limilabs.com/qa/843/authenticate-client-failed-you-might-connecting-non-ssl-port?show=843#q843

On importing certificates and seems OK now.
...