Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reflection of code

Is it possible to use reflection to know what the code is doing, not the types and methods, but rather what is inside the method (if statements, assignment and so on). I know I can disassemble it, but I need to analyze a class at runtime using C#, for example find out how many if conditions there are...

This tool needs to be in C#, any ideas? any classes in the CLR that can open an assembly and allow me to navigate the code within it.

like image 272
user80855 Avatar asked Jan 24 '23 05:01

user80855


1 Answers

Yes. The Microsoft FxCop tool uses an introspection model that is much richer than reflection. You can use the FxCop API to examine expressions in detail.

like image 161
Wim Coenen Avatar answered Feb 04 '23 00:02

Wim Coenen