I want to validate the the property which is visible in the project only and that's a default namespace value on compile action. I was able to find ability to validate project references but this does not provide option to read the default project's namespace.
Is it possible to do with Roslyn Analyzer?
Edit: I found that during Compilation start there is available some property but this does not give wanted information:
context.Compilation.GlobalNamespace.IsNamespace > returns true
context.Compilation.GlobalNamespace.IsGlobalNamespace > returns true
context.Compilation.GlobalNamespace.Name > returns ""
context.Compilation.GlobalNamespace.ToDisplayString() > returns "<global namespace>"
I know that I can go to each class and check the namespace but this is not the case since I want to know the default project's namespace. An example: project name="Project.UnitTests", assembly="Project.UnitTests" and default namespace is "Project.UnitTest". The default namespace is not matching project since project name is plural and namespace is single meaning.