Type initializer throws an exception

Source: Internet
Author: User

public class Clientexceptionutil
{
<summary>
Log Control Object
</summary>
public static readonly ILog logger = Locallogmanage.getlogmanager ();

The reason for the error is: the static variable of the Clientexceptionutil class initially has an exception because of a problem with referencing the log4net DLL version.

1. Access to a static member of a class, while the initialization (or static constructor) of another static member produces an exception. For example, access to classhelper.staticstring, because the initialization of a static member field produces an exception, so calling Classhelper.staticstring throws TypeInitializationException.

2. Access to a static member of the class, the initialization (or static constructor) of the static member produces an exception. For example, Access Classhelper.field.

3. Initialize the class, and some static member in the class initializes (or in a static constructor) an exception occurs. For example Classhelper helper = new Classhelper ().

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.