I want to write a rule that will not be executed if the selection of the object is performed in any method called by the method marked with a certain attribute.
I have got this job so far, iterating through all the methods that call my method, to check with CallGraph.CallersFor() to find out if any of these parent methods have this attribute.
This works for checking parent methods in the same assembly as the method being checked, but reading online it seems that CallGraph.CallersFor() once CallGraph.CallersFor() through all the assemblies, but now it is not.
Question: Is there a way to get a list of methods that call this method, including in another assembly?
Alternative answer: If the above is not possible, how do I go through each method that is called by this method, including in another assembly.
Example:
-----In Assembly A public class ClassA { public MethodA() { MethodB(); } public MethodB() { object o = new object();
I really don't mind when a rule reports an error, at this point it is enough to get an error.
George Duckett
source share