in c#, is there any practicable way to intercept a method line after line, at run-time?
the specific application of interest would be dynamic logging:
if something within a method body threw an exception then on subsequent executions every line of that method would be logged some way or another. it is not known at compile-time which specific methods will throw an exception, so the technique should be able to interfere with most methods in the source code (which could be prepared in some generic way beforehand)
in the imaginary world, the interceptor would also expose parameters for easy identification and evaluation of the specifics of the last line of code executed.
but given this may not be possible at all, is there any rough proxy available for such a tool?
grateful as always.