to log execution order of a C# application
Possible Duplicate:
How can I add a Trace() to every method call in C#?
Is there an easy way to log all called functions (in order of execution, also passed argument values to these f-ns) in a C# application while it is being executed in debug mode in VS2010? For example, I press some button on my form, some complex code is invoked. Now I want to see what functions in what classes with what arguments.
Note that adding debug/trace info to functions is not an option!
IntelliTrace in VS2010
http://msdn.microsoft.com/en-us/library/dd264915.aspx
http://msdn.microsoft.com/en-us/magazine/ee336126.aspx
You need an AOP logger, like Log4Net. Instead of putting in Debug/Trace writes, you decorate the methods you want logged with attributes; the attributes will fire events when the method is entered and exited, which the logger will respond to, writing the text you specify for those events to the log file. I believe you can also specify global rules for logging so you don't even have to decorate each method.
链接地址: http://www.djcxy.com/p/7812.html上一篇: 在JavaScript中访问图像的像素以进行图像处理的最佳方法?
下一篇: 记录C#应用程序的执行顺序