Do you know how to trace all method invocations in an .NET application. My current approach is to write trace at the beginning of each method like this
void DoSomething()
{
using(new Tracer(TraceCategory)
{
//Perform all action here
}
}
But it sucks as it clusters my code and I will have to write traces for all of my method.
Would there another way to record when a method is called, and when it finishes? All suggestions would be appreciate.
The only practical option to implement this I know of is to use AOP (like postsharp) – for a nice walkthrough see here.