I have some C# projects that should have some configurations in the project that references them. I'd like to write a Roslyn analyzer(DiagnosticAnalyzer
) to check if those directly referenced projects are configured.
"directly referenced" means the project is referenced by <ProjectReference ...>
in the .csproj file.
I found a property and thought it would be helpful: Compilation.ReferencedAssembly
.
MS said it would get all "Assembly identities of all assemblies directly referenced by this compilation."
But it gives me all the referenced projects, including direct and transitive.
Am I using it wrongly?