title: How to solve step No.6? contain nullvalue for step 6....... why does step 6 contain empty value(Nullexception)?
body: <pre class="lang-cs prettyprint-override"><code>namespace consoleApp6 {
      public class Person {
          public int Add() {
              return 400;
          }
          static void main() {
              string solutionPath = @"C:\Users\sslindia\source\repos\ConsoleApp6\ConsoleApp6.sln";
              var msWorkspace = MSBuildWorkspace.Create();
              var solution = msWorkspace.OpenSolutionAsync(solutionPath).Result;
              var methodProjectComp = solution.Projects.Single(x = &gt;x.Name == "ConsoleApp6").GetCompilationAsync().Result;
              var classWithMethodToSearchFor = methodProjectComp.GetTypeByMetadataName("ConsoleApp6.Person");
              var methodToSearchFor = classWithMethodToSearchFor.GetMembers("Add").First() as IMethodSymbol; //why this step contain empty value(Nullexception)
              //Nullexception for above step(MethodTosearchFor)
              var references = SymbolFinder.FindReferencesAsync(methodToSearchFor, solution).Result;
              var callers = SymbolFinder.FindCallersAsync(methodToSearchFor, solution).Result;
              int c = references.Select(x = &gt;x.Locations.Count()).Sum();
              Console.WriteLine(c);
          }
      }
  }
  </code></pre>
  
  <p>This is a Roslyn project using symbolfinder class. How to get references to a method using symbolfinder class?</p>