Exploring the Call Stack and Web Searches
Today I was trying to figure out how to get the assembly and type of the class that was calling a method from within the method itself. Since I have MSN Search installed I typed it into my MSN Search box in IE. After several tries without finding anything useful I fired up Google and did one search and came across this great blog post by Michael Ames:
The Call Stack is an indispensable and familiar tool for debugging applications. Sometimes it is helpful to programmatically access the call stack at run-time. For example, a generic logging function could detect and output the name of the class and method that called it. The .NET Framework provides this functionality through the StackTrace, StackFrame and MethodBase classes.
He goes on to demonstrate how to use the call stack which was exactly what I was looking for (thanks Michael!). So why did MSN miss this?