I am trying to find all the references of a type symbol using FindReferencesAsync
. It works well for references within a C# project; however, cross-project references don't appear. Here is the code that I am using.
var model = compilation.GetSemanticModel(_sourceFile.GetSyntaxTree());
ISymbol classSymbol = model.GetDeclaredSymbol(typeDeclarationSyntax);
referencedSymbols.AddRange(SymbolFinder
.FindReferencesAsync(classSymbol, _solution)
.Result.ToList());