These two things can be seen in ILDASM, but there is no description for them in the SDK document.
See the part of the .NET nature, see the part of the initialization:
.cctor is a type initializer, and .ctor is a commonly used constructor.
.cctor will run before .ctor.
The display usage of the initializer is:
Static classname () {..}
That is to say, the same name, with static modified methods. (Very like constructor, right?)
At present, my test results are what this thing is used to initialize the variable, and the STATIC can be initialized.
Another way of use is: static int var = 0; such a direct initialization method.
The code in these two ways will be compiled into .cctor (). The order is static int var = 0; the form is in the form of Static ClassName () {..}.
For constructor, it is another situation:
ClassName () {....}
Without the Static flag, and can have a heavy-duty parameter (type initializer is not available).
INT var = 0 (without STITIC logo), is actually the same as constructor. In the end, both cases will be compiled into .ctor ().
And, .ctor () can have a parameter overloaded form.
Finally, a sentence is summarized: .cctor is running in .ctor.
Luo Luo, probably say so much. Interested in experimenting with yourself.
Although I didn't think of what I used to me ..... just when I met the curiosity.