C# Caller Info AttributesC# provides caller info attributes to get information about the caller method. By using Caller Info attributes, we can get following information.
This information is helpful for tracing and debugging of the source code. To implement this feature, we need to use System.Runtime.CompilerService namespace in our application. This namespace contains the following caller info attributes.
A method which we want to call must use optional parameters. These optional parameters are set to default value. C# compiler set caller info to these parameters during execution of the method. Let's see an example. C# Caller Method Info ExampleOutput Caller method Name: Main Caller method File location: f:\C#\C# Features\CSharpFeatures\CallerInfoExample.cs Caller method Line number: 10 Next TopicC# Using Static Directive |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India