July 2015
Intermediate to advanced
1300 pages
87h 27m
English
Reflection is very powerful and enables you to retrieve every possible bit of information from an assembly and types defined in the assembly, including at runtime. However, you might want to catch some information, typically to log some activities, which would be difficult to retrieve via reflection, at least with an easy approach. The .NET Framework 4.6 makes this easier by offering a set of attributes called caller information. This is the list of new attributes exposed by the System.Runtime.CompilerServices namespace:
CallerFilePath returns the name of the file where a specific code block is being executed
CallerLineNumber ...