Caller class infos

  • Thread starter Thread starter mirko
  • Start date Start date
M

mirko

How can I collect infos about the caller class of a custom
class library (dll), directly by the class library itself?
I tried using the StackTrace class inside the class
library, but the last stack frame (which should collect
infos about the caller) contains only infos about the
class of the calling application.

Example: Suppose that the class library is a custom
component which write a log file. Such logger can be
called either by a class C1 of a client application, or by
a class C2 of a dll which is called inside C1. How can I
distinguish whether the logger is called from C1 or C2?

Thanks.

Mirko
 
Back
Top