Get all projects in an open solution in Rider
Answered
I am building a plugin for .net solutions in Rider.
In Jetbrains Rider, a given .net Solution can have multiple projects inside it. I want to get all the projects available in the currently opened solution. How will I be able to get the available projects?
The use of
ProjectManager.getInstance().openProjects
will always result in the giving an array with only the open solution.
Please sign in to leave a comment.
This is where terminology causes issues :) A "project" in the frontend IntelliJ part of a plugin refers to the IntelliJ concept of a project, which is more similar to a .net solution. You can take a look at
WorkspaceModel.getInstance(project).findProjects()
and various other WorkspaceModel methods and extension functions. This will return the workspace model entity, and more details can be retrieved from the associated descriptor (which might need down casting).
I have a solution here where I read the solution to get the projects as such
If there is any other way to getting the info I need please let me know. I'll just leave this code here in case someone needs it.
Matt Ellis
Would
give me what the IDE considers projects identified inside the loaded project (solution)?