Reflection Question (?)

  • Thread starter Thread starter Largo SQL Tools
  • Start date Start date
L

Largo SQL Tools

I would like some way to determine every place in my solution where a given
method of a given class is called (not defined). Preferably I would like to
know the source file name and line number of each method call. Is this
possible using reflection or some other method?

Thanks very much.

J.R.
Largo SQL Tools
The Finest Collection of SQL Tools Available
http://www.largosqltools.com
 
J.R.,
I would like some way to determine every place in my solution where a given
method of a given class is called (not defined). Preferably I would like to
know the source file name and line number of each method call. Is this
possible using reflection or some other method?

Is there a requirement (of your project) that leads you to want to use
reflection?

If there is not a hard and fast requirement, I would recommend that you do a
simple text search through the source files of the project/solution to find
the source file name and line number.

Hope that helps.

Regards,

Randy
 
Hello Largo,

Thanks for posting in the group.

I suggest you try StackTrace.GetFrame to get a STackFrame object and then
use its GetFileLineNumber and GetMethod function to get the info. This
series of classes are used to get a stack trace info of running application.

Did it answer your question? Please post here if you have follow up
questions.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!From: "Largo SQL Tools" <[email protected]>
!Subject: Reflection Question (?)
!Date: Fri, 5 Sep 2003 21:41:56 -0400
!Lines: 14
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
!Message-ID: <[email protected]>
!Newsgroups:
microsoft.public.dotnet.framework,microsoft.public.dotnet.languages.csharp
!NNTP-Posting-Host: cblmdm65-221-37-137.buckeye-express.com 65.221.37.137
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:182782
microsoft.public.dotnet.framework:53088
!X-Tomcat-NG: microsoft.public.dotnet.framework
!
!I would like some way to determine every place in my solution where a given
!method of a given class is called (not defined). Preferably I would like
to
!know the source file name and line number of each method call. Is this
!possible using reflection or some other method?
!
!Thanks very much.
!
!J.R.
!Largo SQL Tools
!The Finest Collection of SQL Tools Available
!http://www.largosqltools.com
!
!
!
!
 
Back
Top