title: c# Get Calling Method Without Stack Trace
body: <p>I've noticed that .NET 4.5 has a new attribute called <strong>[CallerMemberNameAttribute]</strong> which, when attached to a parameter of a method, will supply the string name of the method that called <em>that</em> method (if that makes sense).</p>
  
  <p>However, unfortunately (because I want to make something with XNA) I'm only targeting .NET 4.0. </p>
  
  <p>I want to be able to do something like:</p>
  
  <pre><code>void MethodA() {
     MethodB();
  }
  
  void MethodB() {
     string callingMethodName = (...?);
     Console.WriteLine(callingMethodName);
  }
  </code></pre>
  
  <p>Where my output would be <em>MethodA</em>.</p>
  
  <p>I know I could do this via stack trace, but that's a) Unreliable and b) Sloooow...
  So I'm wondering if there's any other way to glean that information, however that may be... </p>
  
  <p>I was hoping for any ideas or knowledge that anyone might have on the issue. Thanks in advance :)</p>