When I have this row in a stack of an exception:
WebApiAccessService.<GetStudentKey>d__14a.MoveNext()
What is the "d__14a"? Is it something which could tell me (without symbols) some offset from the start of the method?
When I have this row in a stack of an exception:
WebApiAccessService.<GetStudentKey>d__14a.MoveNext()
What is the "d__14a"? Is it something which could tell me (without symbols) some offset from the start of the method?
The stack trace with the weird name tells you that the exception was thrown in the MoveNext()
method of the <GetStudentKey>d__14a
type.
When you are using async and await the compiler generates some code to implement a state machine. This state machine involves a struct and in your case the name of the struct is <GetStudentKey>d__14a
. Obviously, this is not a legal name for a struct in C# even though it works fine in IL but that is exactly why the compiler uses a name that is guaranteed to not conflict with any name you can create yourself.
You will have to look at the compiler source code to understand how the d__14a
part is generated. Most likely the logic is in the method MakeMethodScopedSynthesizedName
in the GeneratedNames
class but the exact nature of algorithm should not be important.
The compiler will create similar "invalid" names for auto properties, lambda expressions, anonymous types, iterator blocks etc.