title: How to read/interpret a raw C# stack trace correctly?
body: <p>I'm reading some crash reports from a UWP application (C#, compiled with .NET Native) and I'm having a hard time understanding the exact syntax/format used in the stack traces.
  I tried looking for some guides on the internet but I didn't come up with anything useful.</p>
  
  <p>Here are a few examples:</p>
  
  <p><strong>1)</strong> </p>
  
  <pre><code>MyProject.ViewModels.SomeViewModel.&lt;OnLogin&gt;d__69.MoveNext()
  </code></pre>
  
  <ul>
  <li><code>OnLogin</code> is the name of a method in <code>SomeViewModel</code>, so why is it inside angular brackets? Is the <code>"ClassName".&lt;"MethodName&gt;..."</code> the usual way to indicate an instance method?</li>
  <li>I understand that the C# compiler turns every chunk of code between <code>await</code> calls into anonymous methods and schedules them using continuations, so I guess that <code>d__69</code> indicates an async continuation inside the current method.
  
  <ul>
  <li>What does the 'd' stand for?</li>
  <li>Are those numbers random? I mean, the method doesn't have 69 <code>await</code> calls, so I guess those numbers aren't sequential. Is it possible to find out the exact part in the original method from that number in the stack trace?</li>
  </ul></li>
  <li>What is that <code>MoveNext()</code> method at the end? What kind of type is it called upon?</li>
  </ul>
  
  <hr>
  
  <p><strong>2)</strong></p>
  
  <pre><code>MyProject.UserControls.SomeControl.&lt;.ctor&gt;b__0_0
  </code></pre>
  
  <ul>
  <li>I know that <code>.ctor</code> stands for the object constructor, and looking at the code I found out that <code>b__0_0</code> stands for an anonymous event handler added inside the constructor, like this: <code>SomeEvent += (s, e) =&gt; Foo();</code>.
  
  <ul>
  <li>What does the 'b' stand for?</li>
  <li>Why are there two numbers with an underscore? Which one of them refers to the anonymous method index? I mean, it's the first one (so its index is 0) but there are two 0s here. If it was the second, would I have had <code>0_1</code>, <code>1_0</code> or something else?</li>
  </ul></li>
  </ul>
  
  <hr>
  
  <p><strong>3)</strong> I have this method:</p>
  
  <pre><code>// Returns a Task that immediately throws when awaited, as soon as the token is cancelled
  public static Task&lt;T&gt; GetWatchedTask&lt;T&gt;(this Task&lt;T&gt; awaitableTask, CancellationToken token)
  {
      return awaitableTask.ContinueWith(task =&gt; task.GetAwaiter().GetResult(), token);
  }
  </code></pre>
  
  <p>And I have this stack trace:</p>
  
  <pre><code>MyProject.Helpers.Extensions.TasksExtensions.&lt;&gt;c__3$1&lt;System.__Canon&gt;.&lt;GetWatchedTask&gt;b__3_0($Task$1&lt;__Canon&gt; task)
  </code></pre>
  
  <ul>
  <li>Why doesn't the second parameter (the token) show up in the signature?</li>
  <li>Why is the type <code>$Task$1</code> written with the '$' character? Is it like some sort of placeholder/ground indicator (like in a regex) so that it can be used in other places too? (I mean, I see that <code>$1&lt;System.__Canon&gt;</code> in what I guess is the method return type)
  
  <ul>
  <li>If that first part is the method return type, why isn't it there for all the methods that have a return type? I have lots of stack traces with method that do return a value, but they don't have that same signature.</li>
  </ul></li>
  <li>What does all that <code>.&lt;&gt;c__3$1&lt;System.__Canon&gt;</code> mean? From the <code>$1</code> and on I guess that'd be the <code>Task&lt;T&gt;</code> return type, but what's that <code>b__3_0</code> part, since I don't have async calls or event handlers? Does that mean something different in this case?</li>
  </ul>
  
  <hr>
  
  <p><strong>4)</strong></p>
  
  <pre><code>Windows.UI.Xaml.Media.SolidColorBrush..ctor($Color color)
  </code></pre>
  
  <ul>
  <li>Why does the parameter type start with the '$' character? What does it stand for?</li>
  </ul>
  
  <hr>
  
  <p><strong>5)</strong> I have this other method:</p>
  
  <pre><code>public static async Task&lt;ObservableCollection&lt;SomeCustomClass&gt;&gt; LoadItemGroups(String parentId)
  </code></pre>
  
  <p>And this stack trace:</p>
  
  <pre><code>MyProject.SQLiteDatabase.SQLiteManager.&lt;&gt;c__DisplayClass142_3.&lt;LoadGroups&gt;b__3()
  </code></pre>
  
  <ul>
  <li>What's that <code>c__DisplayClass142_3</code>? Is that a way to indicate the return type with a single type rather than the three separate classes (Task, ObservableCollection, SomeCustomClass)?</li>
  <li>Again, why do I have <code>b__3</code> here, where in other stack traces it used the format <code>d_xxx</code> to indicate an async code chunk?</li>
  </ul>
  
  <p>Sorry for the many questions, I hope this post will help other UWP C# programmers too.</p>
  
  <p>Thank you in advance for your help!</p>
  
  <p><strong>EDIT</strong>: this question should <em>not</em> be considered a duplicate of <a href="https://stackoverflow.com/questions/2508828/where-to-learn-about-vs-debugger-magic-names">this other questions</a> because:</p>
  
  <ul>
  <li>It presents different cases (constructor methods, generic types syntax etc..) instead of just asking for the meaning of some default keywords/symbols related to a certain type of variables</li>
  <li>It specifically asks how to compare a given stack trace to an original method signature, and the steps to do in order to achieve that</li>
  <li>It presents different examples in different contexts, instead of just asking a general question</li>
  <li>And by the way, how can "VS debugger magic names" even be considered a proper question title? How was another user supposed to find that question when looking for C# stack traces symbols meaning?</li>
  </ul>