Relative Content

Tag Archive for c#roslyn

C# detect primary constructor with Roslyn

I’m trying to analyse the primary constructor of a class but I can’t find how. It should be possible to find it in the syntax tree, I don’t want to create the semantic model.

Roslyn compilation fail loading dependencies

I’m opening a C# solution/projetcs (csprj) with Roslyn but the compilation fails when resolving all types coming from nuget dependencies.
How to restore packages and/or tell Roslyn to load all binaries in bin folder ?
The solution/projetcs build and run ok in VisualStudio.

expore use of types with roslyn

I need to detect the use of some types and their properties. Types are in external assemblies always. I need to identify their use on current code.
I’m iterating over projects and documents but only local namespaces and types are available using SemanticModel.
Is there any Tree of Referenced Types available in semanticModel ?