Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does prefix to MoveNext mean in the stackstace?

The .NET application crashes with the stack trace:

Call Stack:

Layouts!Layouts.Ribbon.SizeAndPositionControlViewModel+OnLayoutSelectionChanged>d__5.MoveNext() 
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__0(System.Object)
WindowsBase_ni!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) 

The rest of the callstack is Windows code and does not matter.

Here's what the first call implies: In the async method OnLayoutSelectionChanged() in the instance of SizeAndPositionControlViewModel it failed in method MoveNext(). MoveNext() happens to be Microsoft code in a LINQ method method Any.

What does d__5 signify ?

like image 569
Vishnu Pedireddi Avatar asked Jan 10 '14 19:01

Vishnu Pedireddi


1 Answers

The d__5 portion is a prefix that is generated by the C# compiler to keep the construct unique from other generated members / types. In this case the d prefix means that it is an iterator or async method generated class (d is used for both). The number is just incremented for every name that is generated

like image 151
JaredPar Avatar answered Sep 21 '22 23:09

JaredPar