Memcached Memcached.ClientLibrary.SockIOPool "type initializer throws an exception

Source: Internet
Author: User
Tags static class log4net
Another encounter "xxx type initializer throws an exception"

Under a lightweight IOC open-source project implemented in C #, but when used locally, it was discovered that a run caught " type initializer throws an exception" exception information, debugging several times or not to determine exactly where the problem. The impression seems to have encountered this anomaly, the initial estimate is a static class initialization is not successful, but not sure.

Helpless open ilspy View source, found that static initialization of a lot of places, and the code appears layered nested, the class name is numerous, one line to follow up easily around Halo. Toss for a long time did not, but Google, found long ago someone and I met the same problem, a look at the most votes the right solution almost did not go crazy: The project directly add Log4net.dll reference can be.

After testing, sure enough.

Ah ah ah ah ah ah ah ah ah ah ...

Originally is Log4net, unexpectedly is log4net again.

According to personal experience, many open source projects use Log4net to log logs, such as I have encountered when using Ibatis.net, Postsharp, Fastdfs C # client and memcached C # Implementation of a client.

Will the next time you encounter the same problem can quickly find the cause? Can you stop wasting your time? Can you do something more valuable?

Or is it a lack of log4net references? Kao, God knows.

Memcached Memcached.ClientLibrary.SockIOPool "type initializer throws an exception

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.