Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recording the execution path of a C# program?

Tags:

c#

trace

I'm looking for a way to record the execution path of a program (i.e. the branches the program/method takes in a particular execution) into a file. I need this piece of information to know what path my inputs take and make performance-related decisions.

Prof-It for C# looked very promising, but unfortunately it doesn't support the newest versions of Visual Studio.

My current plan is to generate a unique ID at every branch in the program, and during the execution, I record that id. However, this seems to be a very time-consuming process.

like image 474
user1258126 Avatar asked Nov 11 '22 20:11

user1258126


1 Answers

Smth like

Assembly.GetCallingAssembly()
Assembly.GetExecutingAssembly()

or

System.Diagnostics.StackFrame

?

like image 92
sh1ng Avatar answered Nov 15 '22 07:11

sh1ng