Tracking Method use for Classes

  • Thread starter Thread starter Hananiel
  • Start date Start date
H

Hananiel

What is the best way to keep track of all method calls for a given class, in
a given file / assembly. In a large DataBase application we have a program
that automatically generates code / StoredProcedures for all tables in a
database, while what is required is only those stored procs for which there
are functions in a given class being called. I would like to remove the
rest. So I need to track the use of all methods being used in one class.
Thanks,
Hananiel
 
Hananiel,

Maybe if you created a seperat threat which read the call stack
using the StackClass in System.Diagnostics you can do this (I have
not tired) other than that, you will have to make modifications to your
existing classes/methods to log thier use somewhere.

PS: You could use a profiler tool to monitor your application and check
for exdcution coverage in your application and find code which is never
executed.

HTH,

//Andreas
 
That is not very helpful because, at runtime, I cannot guarantee all paths
of execution. I need this information at compile time. Is there anyway to
programatically access the c# compiler routines or is there some thing in
reflection to do this kind of thing? But thanks Andreas for taking the time.

-Hananiel
 
Back
Top