Caller Info Attributes in C# 5.0
- by Jalpesh P. Vadgama
In c# 5.0 Microsoft has introduced a Caller information attribute. It’s a new feature that is introduced in C# 5.0 and very useful if you want to log your code activities. With the help of this you can implement the log functionality very easily. It can help any programmer in tracing, debugging and diagnostic of any application. With the help of Caller Information we can get following information over there. CallerFilePathAttribute: With help of this attribute we can get full path of source file that contains caller. This will be file path from which contains caller at compile time. CallerLineNumberAttribute: With the help of this attribute we can get line number of source file which the method is called. CallerMemberNameAttribute: With the help of this attribute we can get the method or property name of the caller. Read more