0

Suppose I have the following code

public class RandomClass
{
    public void MethodOne(){
        MethodTwo();
        Console.WriteLine("Include Scarab");
    }

    public void MethodTwo(){
        Console.WriteLine("Scarab");
    }
}

Is there a tool that I can use that will analyze a method (in this case MethodOne) and return all lines that contain a string (in this case Scarab)? In this case the tool would return Console.WriteLine("Include Scarab"); and Console.WriteLine("Scarab");.

This would span across methods that are called through different files and projects within a solution.

  • Could you please explain what problem you solve by not just using a global search on that specific string? – Thomas May 16 '19 at 7:45
  • In the solution, there is a class with an enum of various errors defined. As a result, I would have to continually check to see all references of each error to see which HTTP route generates the error. Using the tool, I would be able to pretty much see what errors are called by each method through the business and data layers. – Riaru Neimu May 16 '19 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.