C#,vb.net,MVC,Jquery,javascript,jscript,vbscript,html,vb,sharepoint,COM,WPF,WCF,Wwf,Asp,Asp.net,questions & answers,

Latest in Sports

Friday, September 5, 2014

Caller Information- c# New features

 Caller Information

It is now easier from C# 5.0 onwards to get the log information in case of any error occurs with the help of .net framework.

We can use System.Runtime.CompilerServices namespace to log the error and method information. Some of the important

attributes to use are : CallerFilePath, CallerLineNumber and CallerMemberName.


Example:
  Output :

No comments:

Post a Comment