In this short code example I’m going to show you a method to identify what class (including the namespace) you’re currently in and what the name of the current method is. You can also use this technique to find out more information about the method but I won’t go into that detail here.

System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.FullName 'Get Current Class Name and Namespace
System.Reflection.MethodBase.GetCurrentMethod().Name 'Get Current Method Name
How to find out current class/method name
Tagged on:

One thought on “How to find out current class/method name

  • 13 December 2014 at 8:54 pm
    Permalink

    Solved my problem. Thanks!

    Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.