What does <.ctor> mean when it appears in a symbol in .Net
I have a symbol that 开发者_Go百科appears that is listed as
MyNamespace.MyClass.<.ctor>b__8()
What exactly does the <.ctor>
mean? Or the b__8()
for that matter?
This member is a method generated by C#'s compiler for a lambda expression or anonymous delegate used in MyClass
's constructor. The part in <>
is the name of the method where the lambda expression/anonymous delegate was seen, and b__8
is just a meaningless suffix to make the method name unique.
NB: this naming scheme is an internal implementation detail of C#'s compiler. Don't rely on it if you can help it.
Apparently, the <.ctor> simply is the constructor. The b__8() represents a lamba in that method.
精彩评论