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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top