Tracking Method use for Classes

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
 
A

Andreas Håkansson

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
 
H

Hananiel

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
 

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

Top