I have a symbol that appears that is listed as
MyNamespace.MyClass.<.ctor>b__8()
What exactly does the <.ctor>
mean? Or the b__8()
for that matter?
I have a symbol that appears that is listed as
MyNamespace.MyClass.<.ctor>b__8()
What exactly does the <.ctor>
mean? Or the b__8()
for that matter?
Apparently, the <.ctor> simply is the constructor. The b__8() represents a lamba in that method.
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.