I listed all the projects in my solution using EnvDTE, but found an error in my code: I cannot get projects that are unloaded.
I found a way to skip unloaded projects:
if (string.Compare(EnvDTE.Constants.vsProjectKindUnmodeled, project.Kind, System.StringComparison.OrdinalIgnoreCase) == 0) continue;
This way my code does not crash, but I cannot load the missing projects through the code as they already exist.
How to load uploaded projects into the solution?
I tried:
project.DTE.ExecuteCommand("Project.ReloadProject");
And the error turned out:
System.Runtime.InteropServices.COMException (...): The "Project.ReloadProject" command is not available.
So, I tried to somehow get
application.DTE.ExecuteCommand("Project.ReloadProject");
But before that, from all the places that I was looking for in NET, I have to pre-select the project in the solution - and for this I need project.Name (which I have) and the path that I do not, t (in each example, which I found, it is assumed that the solution path is the same as the path to the project, which is unlikely in the general situation).
source share